433 Commits

Author SHA1 Message Date
Daniel Marjamäki
58066b1f0c Remove whole program analysis from 'uninitialized variables' and 'null pointer dereference' checkers. I think this logic can more or less be added in ValueFlow instead and then all ValueFlow checkers should get whole program analysis. 2018-02-06 14:56:17 +01:00
Daniel Marjamäki
71511f3131 Refactor f487182 2018-02-06 08:59:36 +01:00
Ivan Maidanski
f487182075 Suppressed unused functions should not lead to nonzero exit code () ()
This is a fix of commit 97ffec8.
2018-02-06 07:44:53 +01:00
Daniel Marjamäki
dbc6771a0b Uninitialized variables: Fix FP for unknown macro like 'list_for_each' 2018-02-04 22:30:08 +01:00
Daniel Marjamäki
4998248501 Null pointers: Fixed false positives when running whole program analysis. Copied the fix from the CheckUninitVar::isUnsafeFunction. 2018-02-04 15:29:57 +01:00
Daniel Marjamäki
d47b7726fa Uninitialized variables: Fix potential false positives in subfunction if there is early return or conditional writes 2018-02-04 09:40:57 +01:00
Daniel Marjamäki
1fe59faecb changed message ids for uninitvar/nullpointer errors that was found by whole program analysis 2018-02-03 16:05:07 +01:00
Daniel Marjamäki
f5a11a6510 UninitVar: Speedup whole program analysis a bit 2018-01-29 15:15:35 +01:00
Daniel Marjamäki
9109956c8c UninitVar: Improve whole program analysis, used isVariableUsage() 2018-01-25 21:49:21 +01:00
Daniel Marjamäki
51c2ded23f Fix crash 2018-01-25 19:42:50 +01:00
Daniel Marjamäki
4d66609173 Fix Cppcheck warning, uninitialized member variable 2018-01-25 17:29:08 +01:00
Daniel Marjamäki
f73da16e94 Revert "UninitVar: Better checking in whole program analysis"
This reverts commit b2bdc2687ba1bccd2c64322f39e0481683709120.
2018-01-25 17:05:57 +01:00
Daniel Marjamäki
b2bdc2687b UninitVar: Better checking in whole program analysis 2018-01-25 15:56:46 +01:00
Daniel Marjamäki
ce60b326f4 Whole program analysis: Improved handling of nested calls 2018-01-24 22:53:14 +01:00
Daniel Marjamäki
512b9f512c Refactoring whole program analysis for CheckUninitVar and CheckNullPointer 2018-01-21 22:56:46 +01:00
Daniel Marjamäki
351b382a7b Null pointers: Whole program analysis 2018-01-21 19:51:15 +01:00
Daniel Marjamäki
ea63e52d98 UninitVar: Improved function/method matching in whole program analysis 2018-01-21 10:40:35 +01:00
Daniel Marjamäki
c331a10fa7 Refactorings, and try to ensure that analyzer info is stored/loaded properly 2018-01-15 19:12:31 +01:00
Daniel Marjamäki
f2b2e87fb6 Uninitialized Variables: some additional tweaks. Try to fix Travis 2018-01-15 17:35:21 +01:00
Daniel Marjamäki
100887429d Uninitialized variables: Whole program analysis for function calls 2018-01-15 15:54:09 +01:00
Daniel Marjamäki
c4caee6b18 Updated copyright year 2018-01-14 15:37:52 +01:00
Daniel Marjamäki
255b788d4d Fixed (Improve check: allocated but not initialized (condition)) 2018-01-02 23:20:46 +01:00
Daniel Marjamäki
ba8222de1c ValueFlow: Put 'inconclusive' state in the ValueKind. A value can't be both known and inconclusive. 2017-09-20 22:41:36 +02:00
Daniel Marjamäki
57004ed533 Fixed (False positive: uninitialized variable (multi variables in inner scopes)) 2017-09-07 23:08:55 +02:00
Daniel Marjamäki
d160d27417 Fixed (False positive uninitvar on sizeof *ptr) 2017-08-23 22:17:49 +02:00
Daniel Marjamäki
e087156e30 CheckUninitVar: Try to activate the valueflow based checking again 2017-08-20 19:54:06 +02:00
Daniel Marjamäki
22919da9a8 Fixed (Defect: False positive due to ignoring struct initialisation when nested in a loop and assigned to a member) 2017-06-30 13:41:19 +02:00
Daniel Marjamäki
3ab8466415 refactoring, use early continue in for loop 2017-06-30 12:45:48 +02:00
Ayaz Salikhov
3cd2f2d092 Don't cast bool to bool 2017-06-01 01:49:40 +03:00
Ayaz Salikhov
28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
Daniel Marjamäki
95db173e77 Fixed Cppcheck warning 2017-05-13 11:06:33 +02:00
Daniel Marjamäki
f51a709f80 add fixme comment 2017-05-01 11:25:58 +02:00
Daniel Marjamäki
ce6cc5416a uninitvar: made ValueFlow check experimental 2017-05-01 11:13:30 +02:00
Daniel Marjamäki
06102cb3d7 UninitVar: Don't warn for inconclusive values 2017-04-28 21:09:56 +02:00
Daniel Marjamäki
2f51b975ed valueFlowUninit: only check variables 2017-04-23 21:50:51 +02:00
Daniel Marjamäki
25a1ea3d18 use simpleMatch for simple pattern 2017-04-23 19:25:35 +02:00
Daniel Marjamäki
8a738eefab fixed (uninitialized variable is not found when used with switch/case) 2017-04-23 18:05:14 +02:00
Daniel Marjamäki
43454936e7 Fixed (FP: Uninitialized variable 'f(1,{..});') 2017-04-21 22:33:27 +02:00
PKEuS
3c8f5b85ae Refactorization: Allocate Token::_values (ValueFlow information) dynamically, reducing size of each token by around 10% 2017-03-27 18:48:34 +02:00
PKEuS
2f0db369f0 Refactorization: Avoid construction of empty strings by using emptyString 2017-03-01 10:50:50 +01:00
Matthias Krüger
6f1e7e897d simplify if(tok && Token::{simple,}Match) to if(Token::{simple,}Match). 2017-02-06 15:37:12 +01:00
Daniel Marjamäki
c8a450c9be uninitvar: Fixed a FP seen in daca2 2016-12-25 22:43:29 +01:00
Daniel Marjamäki
d79688c40b Fixed (False positive for uninitialized variable if array type is used) 2016-12-21 23:11:11 +01:00
PKEuS
2f6350a0d0 Refactorized Library 2016-12-06 14:09:28 +01:00
Matthias Krüger
b3ace258ab there is no need to have "if(tok && Token::Match(tok,..." since Token::Match checks "tok" by itselfs already. 2016-11-26 17:22:30 +01:00
orbitcowboy
a81920cae1 checkunusedvar: Check pointer against NULL before dereferencing it. 2016-10-31 15:57:34 +01:00
orbitcowboy
bc32ccc894 CheckUninitVar::isFunctionParUsage: Avoid implicit conversion from type bool to int. 2016-10-29 21:41:55 +02:00
PKEuS
e1a21a8bb1 Fixed internal warnings 2016-10-08 11:34:25 +02:00
Harald Scheidl
9f1b70fa04 new can initialize memory, don't warn in this case () 2016-10-08 10:03:09 +02:00
Daniel Marjamäki
9711064b74 Fixed (False positive uninitvar - loopvariable initialized inside loop) 2016-08-04 14:39:54 +02:00