Commit Graph

163 Commits

Author SHA1 Message Date
chrchr-github b04bf7396f
Fix New check: Not needed c_str() operation () 2022-08-20 20:52:10 +02:00
Oliver Stöneberg 4bf5dcd29f
cleaned up includes based on include-what-you-use ()
* cleaned up includes based on include-what-you-use

* testlibrary.cpp: no need for `empyString` optimization
2022-08-14 12:44:19 +02:00
chrchr-github 078a6d7804
Fix FP knownConditionTrueFalse with constexpr? () 2022-08-07 19:06:19 +02:00
Paul Fultz II a2f2699088
Refactor alias check in isExpressionChangeAt into isAlias function () 2022-06-28 22:40:59 +02:00
Paul Fultz II e735376f7d
Refactor to use AST for isContainerSizeChanged () 2022-06-19 08:17:05 +02:00
Paul Fultz II de51ebbcf4
Fix 9135: Access of moved variable not detected in loop ()
* Fix 9135: Access of moved variable not detected in loop

* Format

* Fix issue with pushing back on container

* Format

* Fix null pointer

* Remove yeild for now
2022-06-16 17:40:09 +02:00
chrchr-github e6f2929fac
Fix FN constVariable with range-based for () 2022-06-03 19:24:59 +02:00
Oliver Stöneberg cc08a661e6
astutils.h: reserve `std::vector` space in `visitAstNodes()` to avoid excess allocations () 2022-06-03 19:21:17 +02:00
Oliver Stöneberg 3d5d2e8fd8
inlined `findAstNode()` calls () 2022-05-31 13:37:21 +02:00
chrchr-github 7fbb9c7c13
Fix FN constVariable with range-based for loop ()
* Fix  FN constVariable with range-based for loop

* Format

* nullptr check

* Restrict scopes

* Add const

* Undo

* Add more const
2022-05-29 17:06:33 +02:00
Oliver Stöneberg 14421ae627
fail `run-clang-tidy` in case of compiler warnings / fixed Clang warnings / cleanups () 2022-05-15 12:42:29 +02:00
Paul Fultz II fbba72ab5a
Fix 11057: FP danglingTemporaryLifetime with reference member ()
* Fix 11057: FP danglingTemporaryLifetime with reference member

* Add test

* Format

* Use ast for number of arguments

* Get number of arguments using ast

* Skip aggregate constructor when there are too many arguments

* Format
2022-05-13 06:51:07 +02:00
Oliver Stöneberg 45158ec064
cleaned up includes based on include-what-you-use ()
* cleaned up includes based on include-what-you-use

* updated translations
2022-04-13 12:24:00 +02:00
chrchr-github 63d96e49fc
Fix , FP constStatement ()
* Fix ,  FP constStatement

* Fix test cases (first one did not compile)
2022-03-27 07:59:29 +02:00
chrchr-github e54ad24d2c
Fix FN constStatement with arrays () 2022-03-25 11:32:16 +01:00
chrchr-github 39567ea8c8
Fix FP variableScope (std::for_each with lambda) () 2022-03-22 21:50:46 +01:00
Paul Fultz II 0b310b9d07
Fix 10702: FP knownConditionTrueFalse - Member variable modified ()
* Fix 10702: FP knownConditionTrueFalse - Member variable modified

* Format

* Make parameter const

* Fix FP

* Fix FP

* Update

* Format
2022-02-28 18:54:55 +01:00
Paul Fultz II 45de9a7d08
Refactor: Use getEndOfExprScope instead of getEndOfVarScope () 2022-02-24 06:50:34 +01:00
Oliver Stöneberg 75b6e8d258
inline visitAstNodes() calls () 2022-02-13 20:46:01 +01:00
Oliver Stöneberg 6e57cc4323
small utils.h cleanup () 2022-02-11 19:44:08 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
Armin Müller 5a05631c84
Typos found by running "codespell" () 2022-01-13 17:24:26 +01:00
Oliver Stöneberg 0ba9cb4e64
fixed some unusedFunction warnings () 2022-01-04 15:48:08 +01:00
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
Paul Fultz II 12e731ad49
Fix 10605: FP containerOutOfBounds with empty() check () 2021-11-25 22:34:00 +01:00
Daniel Marjamäki f701a9361d chmod; Use 644 for source files 2021-11-17 08:25:25 +01:00
Paul Fultz II a0d3c2c719
Handle for loop conditions in afterCondition () 2021-11-14 18:30:36 +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 48fc70b810
Dont stop analysis when an unrelated class variable is changed () 2021-10-23 14:47:10 +02:00
Paul Fultz II 89515600e4
Fix 10538: FN: nullPointer (std::swap pointers) () 2021-10-15 10:58:16 +02:00
Paul Fultz II 8668d445c7
Add support for string_view () 2021-10-05 08:28:19 +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
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
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 59a1c1a9d8
Refactor: Remove variable analyzer () 2021-07-18 07:46:31 +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
Daniel Marjamäki d549770b5b updated extracttests.py. fix syntax errors in test cases. 2021-05-13 20:21:02 +02:00
Oliver Stöneberg 6397e29f84
cleaned up includes based on include-what-you-use () 2021-04-03 21:30:50 +02:00
Paul Fultz II 5077663684
Fix issue 9979: false positive: containerOutOfBounds with conditional resize () 2021-03-30 14:02:28 +02:00
Daniel Marjamäki 42437277dc Update Copyright year 2021-03-21 20:58:32 +01:00
Paul Fultz II 0e871c178f
Fix issue 10141: Errors with ref assignment (duplicateValueTenary and knownEmptyContainer) () 2021-02-09 15:27:46 +01:00
IOBYTE 4e1ff86bb2
use nonneg int for varid and exprid () 2021-01-27 19:49:13 +01:00
Ken-Patrick Lehrmann 00707455be
10110: Fix FP knownConditionTrueFalse () 2021-01-25 17:23:47 +01:00
Paul Fultz II c860de8565
Fix issue 8143: valueFlowCondition: before and inside while () 2021-01-23 17:52:01 +01:00
Paul Fultz II b1c56d33ac
Fix issue 9133: Invalid iterator; vector::push_back, functions () 2021-01-11 18:47:38 +01:00
Daniel Marjamäki b8f45a5c65 Replace and fix findBreakScope with findNextTokenFromBreak 2020-12-25 08:43:14 +01:00
Daniel Marjamäki 8bd783f820 Refactoring; Added findBreakScope and Scope::isLoopScope() 2020-12-24 22:58:31 +01:00