Commit Graph

12627 Commits

Author SHA1 Message Date
abhijit-sawant b97387db66
Made missing comparison in loop check more generic () 2021-01-18 08:11:37 +01:00
IOBYTE dd866f2898
fix using type alias with derived class () 2021-01-17 16:10:53 +01:00
Oliver Stöneberg b2ed372f75
various optimizations () 2021-01-16 19:05:51 +01:00
Oliver Stöneberg 9f9a652ae1
refs issue : avoid usage of expensive std::stringstream () 2021-01-16 19:03:28 +01:00
Daniel Marjamäki 853c271f22 Fix gcc warning; variable vidx is assigned but not read 2021-01-16 18:13:06 +01:00
Oliver Stöneberg 7aa85aa408
Use std::unordered_* containers for faster lookups () 2021-01-16 13:52:09 +01:00
Daniel Marjamäki 76f759fcc4 Fixed (False positive: Opposite inner condition when modifying member variable used by inner condition) 2021-01-15 20:51:47 +01:00
Daniel Marjamäki 503662f625 Try to fix null pointer dereference 2021-01-15 08:27:58 +01:00
Daniel Marjamäki 55262f03ec Fixed (False positive: Searching before insertion is not necessary (stlFindInsert)) 2021-01-14 22:31:43 +01:00
Daniel Marjamäki a5babf25a7 Fixed (syntax error: operator) 2021-01-14 20:56:11 +01:00
Ken-Patrick Lehrmann 56124f0c5d
Skip calculateWarningHash if we are not in bugHunting () 2021-01-13 18:38:00 +01:00
Paul Fultz II b571e9fe0b
Fix issue 10106: FP: nullPointerRedundantCheck () 2021-01-13 12:36:26 +01:00
Paul Fultz II b469da1069
Fix issue 8253: False negative: Comparison is always true (early return) () 2021-01-13 12:35:43 +01:00
Daniel Marjamäki 1858465bca astyle formatting
[ci skip]
2021-01-12 21:28:56 +01:00
Daniel Marjamäki 5f21d9d97b Fixed (Syntax error for valid C code) 2021-01-12 21:28:07 +01:00
Armin Müller 0de0a954d2
Typos found by running "codespell" () 2021-01-12 20:48:25 +01:00
Paul Fultz II fc4238829f
Fix issue 10092: false positive: (warning) The address of local variable 'data' might be accessed at non-zero index. () 2021-01-12 10:24:28 +01:00
Paul Fultz II b1c56d33ac
Fix issue 9133: Invalid iterator; vector::push_back, functions () 2021-01-11 18:47:38 +01:00
Paul Fultz II 678ee00fe9
Infer variables from conditions in valueFlowSubfunction () 2021-01-11 08:00:13 +01:00
Paul Fultz II a3617fe573
Fix issue 10102: False positive: knownConditionTrueFalse in for loop () 2021-01-11 07:56:16 +01:00
Rikard Falkeborn f018163551
Improve handling of realloc in memory leak checker ()
Mark realloced variables as realloced instead of freed. This allows
improved checking for code with error realloc handling.

If cppcheck finds an if-statement which checks the validity of the
allocated memory or resource, check if the memory/resource is
reallocated from another variable. If so, we can add checking of that
variable in the if-statement instead. This allows to check that variable
for memleaks and double frees.

This fixes  and  which both concern FPs with double frees
after correct error handling.
2021-01-11 07:55:05 +01:00
Daniel Marjamäki 707f1f2fbe ValueFlow: Fixed isEqual 2021-01-10 16:52:11 +01:00
Daniel Marjamäki 98c7c0af96 Fixed GCC compiler warnings 2021-01-10 15:27:42 +01:00
Daniel Marjamäki 4e07a13feb ClangImport: If typeIndex is negative we want to have Cppcheck warnings about that 2021-01-10 14:51:28 +01:00
Daniel Marjamäki f493ce16b3 astyle formatting
[ci skip]
2021-01-10 14:46:19 +01:00
Paul Fultz II bc3f5554a4
Fix issue 8871: improve check: mismatching container size conditions () 2021-01-10 13:30:00 +01:00
Oliver Stöneberg ac7647fcd8
some self-check suppression cleanups () 2021-01-09 20:32:38 +01:00
IOBYTE 2482873029
fix location of forward declaration of specialized template () 2021-01-09 20:00:35 +01:00
Daniel Marjamäki f6c98a0999 Fix Cppcheck self check warning 2021-01-09 11:14:41 +01:00
Paul Fultz II c267d85640
Add generic valueflowBeforeCondition () 2021-01-08 22:55:04 +01:00
Daniel Marjamäki 4b5aedbbab Fixed (FP: duplicateExpression clangimport) 2021-01-08 22:30:06 +01:00
Paul Fultz II 3b5c558414
Fix issue 10076: ValueFlow: False positive after address of var is taken 'T t = {{&var}};' () 2021-01-08 10:29:32 +01:00
Rikard Falkeborn bedf3118ef
library: Refactor to use enum class () 2021-01-08 10:29:01 +01:00
IOBYTE 503a5dd441
fix (Hang: TemplateSimplifier::useDefaultArgumentValues) () 2021-01-06 23:06:50 +01:00
IOBYTE cb02628c7c
fix (namespace alias changes variable name) () 2021-01-06 17:30:11 +01:00
IOBYTE c085151eb0
fix exprengine.cpp:2833:18: debug: Executable scope 'executeAllFunctions' with unknown function. () 2021-01-06 17:29:23 +01:00
Rikard Falkeborn 50cdb6cbfc
Astyle: sync windows and linux folders () 2021-01-06 17:13:44 +01:00
Daniel Marjamäki 9e4e06a524 Clang import; Testing that token index is set properly 2021-01-06 11:19:14 +01:00
Daniel Marjamäki 0bd401c17b ClangImport; Assign token indexes 2021-01-06 11:07:21 +01:00
Daniel Marjamäki 168db9351d ClangImport; set exprid 2021-01-06 11:03:43 +01:00
Daniel Marjamäki 3a86262244 SymbolDatabase: Do not set definedType for global scope etc 2021-01-06 08:53:45 +01:00
IOBYTE 22b10f8987
fix token.cpp:745:19: debug: Executable scope 'getStrSize' with unknown function. () 2021-01-05 22:07:53 +01:00
Oliver Stöneberg 96704c9971
fixed and enabled some more clang-tidy warnings () 2021-01-05 17:51:32 +01:00
Paul Fultz II e004731f1c
Fix issue 8650: ValueFlow: Track if pointer is created by '&' operator () 2021-01-05 16:56:38 +01:00
IOBYTE 8897ad3408
fix (typedef not replaced when namespace is involved) () 2021-01-05 16:53:56 +01:00
Paul Fultz II f0b5668436
Fix issue 9890: ValueFlow: known value not found (variable is changed in path that returns) () 2021-01-05 16:49:08 +01:00
Paul Fultz II a95c931da0
Fix issue 8501: false negative: (style) Opposite expression on both sides of () 2021-01-05 12:07:27 +01:00
Daniel Marjamäki b3b7ecc7ea Removed integerOverflowOptimization checking and merged functionality into invalidTestForOverflow 2021-01-05 11:38:19 +01:00
Daniel Marjamäki abd6c00c82 Integer overflow; generalized checking for nonportable code 2021-01-04 19:43:05 +01:00
orbitcowboy 02b714f6dc Code formatting [ci skip] 2021-01-04 13:09:05 +01:00