Commit Graph

402 Commits

Author SHA1 Message Date
Oliver Stöneberg 54b54567cf
astutils.cpp: optimized isSameExpression() a bit - reduces average Ir from 294 to 213 when analyzing test folder () 2021-12-11 15:10:15 +01:00
chrchr-github f64097465f
Fix FP oppositeExpression - negated value is not opposite for bitwise logical operators () 2021-12-10 18:06:45 +01:00
chrchr-github 33c55f77a8
Fix () 2021-12-07 07:44:07 +01:00
Paul Fultz II 12e731ad49
Fix 10605: FP containerOutOfBounds with empty() check () 2021-11-25 22:34:00 +01:00
Paul Fultz II a0d3c2c719
Handle for loop conditions in afterCondition () 2021-11-14 18:30:36 +01:00
Paul Fultz II 13f5b560ce
Fix 10555: FP knownConditionTrueFalse with non-const function in base class () 2021-11-12 20:05:43 +01:00
Paul Fultz II c057dcce0f
Fix 10592: False positive: returnDanglingLifetime () 2021-11-11 08:00:05 +01:00
Paul Fultz II 035c70c441
Fix 10578: Value not impossible after check () 2021-11-07 18:19:56 +01:00
Paul Fultz II a50596df72
Fix 10582: ValueFlow; wrong known value () 2021-11-07 06:51:51 +01:00
Paul Fultz II d3f0aa5b34
Fix 10033: false negative: danglingTemporaryLifetime with usage of reference from nested object not detected () 2021-11-01 19:23:15 +01:00
Paul Fultz II 8c9c46835a
Fix for 6597: false negative: uninitialized variable usage not detected (ValueFlow , multi variables) () 2021-10-30 22:13:58 +02:00
Daniel Marjamäki 1f01845efb Fixed (FP unreadVariable with reference and *=) 2021-10-25 19:34:19 +02:00
Paul Fultz II 48fc70b810
Dont stop analysis when an unrelated class variable is changed () 2021-10-23 14:47:10 +02:00
Paul Fultz II 876702c4f2
Fix 10098: false negative: 'Reference to temporary returned.' not detected with class () 2021-10-15 10:59:40 +02:00
Paul Fultz II 89515600e4
Fix 10538: FN: nullPointer (std::swap pointers) () 2021-10-15 10:58:16 +02:00
Paul Fultz II 130d1abbce
Fix 10210: FN: nullPointerRedundantCheck regression in member function () 2021-10-15 10:57:40 +02:00
Paul Fultz II 3cb252bd99
Fix 9873: False negative: null pointer when checking raw pointer () 2021-10-06 08:39:58 +02:00
chrchr-github f3e1f0d41b
Fix : char* confused with char () 2021-10-05 18:04:48 +02:00
Paul Fultz II 8668d445c7
Add support for string_view () 2021-10-05 08:28:19 +02:00
Paul Fultz II 71809044bd
Fix 10522: FP: derefInvalidIterator when using emplace with 1 argument () 2021-10-05 08:23:47 +02:00
chrchr-github 428144c53c
Fix : vector constructed from pointers () 2021-10-04 07:55:17 +02:00
Daniel Marjamäki f3d9755e65 UninitVar: too many warnings (pointer dereference) 2021-10-03 18:12:29 +02:00
chrchr-github 609e20d9d8
ValueFlow: string can be constructed from init list () 2021-10-02 23:09:49 +02:00
chrchr-github 0c16e346f1
Minor: add endsWith() template, empy() check () 2021-09-28 20:34:21 +02:00
Paul Fultz II 5c3b69fe96
Fix 10496: crash: endless recursion (symbolDatabaseCreateExprId => isSameExpr => isSameExpr ...) () 2021-09-25 11:55:49 +02:00
Daniel Marjamäki 2ee920dc4e Fixed (False positive: unreadVariable when assigning to reference returned by method) 2021-09-24 07:30:17 +02:00
Daniel Marjamäki 6f4ce486a2 Fix FP in constVariable 2021-09-11 20:25:46 +02:00
Paul Fultz II 0335671b35
Fix 10450: regression, FP : Iterator 'iter' from different container 'l' are used together () 2021-09-05 07:35:33 +02:00
Ken-Patrick Lehrmann 4296859c1a
Remove usage of std::vector and getArguments from getTokenArgumentFunction ()
getTokenArgumentFunction can be called many many times, and the vector
is not needed, but it can become quite costly.
This patch replaces getArguments with a function simply returning the
position of the token, if it is found in the arguments (thus saving the
cost of std::vector).
2021-09-01 10:51:44 +02:00
Daniel Marjamäki 6541efdb9a fix selfcheck warning 2021-08-27 22:33:03 +02:00
Daniel Marjamäki a55b0c332a Fixed (False positive: unreadVariable) 2021-08-27 17:37:42 +02:00
Paul Fultz II 865163b2ba
Add library configurations for free functions like std::size, std::empty, etc () 2021-08-23 09:03:48 +02:00
Paul Fultz II 7f358b2bed
Format with uncrustify () 2021-08-07 20:51:18 +02:00
Paul Fultz II 8b8ae55490
Fix 10129: false negative: knownConditionTrueFalse ()
* Add symbolic matching

* Check for truncated values

* Dont propagate uninit values

* Update errorpath test

* Add test case for 10129

* Add test case for FP

* Remove symbolic values that are the same as the token

* Fix test messages

* Fix cppcheck issue

* Format
2021-08-04 21:07:31 +02:00
chrchr-github 28c8b00e5c
Minor: fix MSVC shadow warning () 2021-08-04 08:16:02 +02:00
Paul Fultz II 3a7ba3cd29
Add symbolic values to ValueFlow () 2021-07-30 21:29:35 +02:00
Paul Fultz II 00eb71fd49
Remove constexpr -> const simplification () 2021-07-22 07:22:26 +02:00
orbitcowboy 1be5bb8bbc Running astyle [ci skip] 2021-07-18 10:01:22 +02:00
Paul Fultz II 59a1c1a9d8
Refactor: Remove variable analyzer () 2021-07-18 07:46:31 +02:00
Paul Fultz II 3b9c399f72
Fix 10338: Hang/Crash in valueflow () 2021-07-07 08:20:32 +02:00
Paul Fultz II dd178c3ad9
Fix 10314: Possible nullPointerRedundantCheck false positive () 2021-06-19 13:59:48 +02:00
Paul Fultz II 3e78e76fe8
Fix issue 10076: ValueFlow: False positive after address of var is taken 'T t = {{{&var}}};' () 2021-06-03 07:31:46 +02:00
Paul Fultz II 5f0fe1dfe7
Fix another FP with range for macro () 2021-05-26 04:52:55 +02:00
Paul Fultz II e2d9aaf23b
Fix 10286: false positive: uninitvar ()
* Fix 10286: false positive: uninitvar

* Remove header
2021-05-23 07:58:19 +02:00
Paul Fultz II 5409fa8afd
Fix disabled valueFlowUninit tests () 2021-05-21 07:28:34 +02:00
Daniel Marjamäki f1fff5e904 Fixed (ValueFlow/TokenList: function pointer dereference and call) 2021-05-20 13:54:17 +02:00
Daniel Marjamäki 216918756b Fixed (FP: (style) Variable '((uint8_t*)(uint16_t)0x1000)[0]' is assigned a value that is never used.) 2021-05-18 20:35:00 +02:00
Daniel Marjamäki 404b82fc21 unused var; fix todo test cases, redundant assignment of array in loop 2021-05-14 19:07:30 +02:00
Daniel Marjamäki d549770b5b updated extracttests.py. fix syntax errors in test cases. 2021-05-13 20:21:02 +02:00
Daniel Marjamäki 75311fba0f Fixed (FP uninitvar with input from stringstream in for loop) 2021-05-10 19:48:07 +02:00