Commit Graph

420 Commits

Author SHA1 Message Date
chrchr-github 4c8aa56d8b
Partial fix for internalAstError regressions (iscpp11init) ()
* Partial fix for  internalAstError regressions (iscpp11init)

* Use %cop%

* Add test for 

* Format

* Format
2022-12-16 10:46:15 +01:00
Paul Fultz II 663a8411dd
Fix 11416: FP nullPointerRedundantCheck for check after loop with break () 2022-12-08 07:27:06 +01:00
Rikard Falkeborn 52264b9c26
Fix nullpointer dereference with alignof ()
* checknullpointer: Don't report dereference with alignof

* Refactor unevaluating operator check in checknullpointer

Unifying these ensures the different checks treat the operators the
same.

* Fix FP with _Alignof and null pointer

Just like alignof, _Alignof does not evaluate its operand.

* CheckNullPointer: Also support compiler specific alignof

This fixes  which is about __alignof__. For good measure, also add
the microsoft extensions __alignof and _alignof.
2022-11-27 09:20:19 +01:00
chrchr-github 45ccc9ba1e
Fix ctunullpointer FP () 2022-09-16 12:11:34 +02:00
Oliver Stöneberg b3ec225480
iwyu.yml: use `debian:unstable` to always get latest include-what-you-use / cleaned up includes ()
* iwyu.yml: use debian:unstable to always get latest include-what-you-use

* cleaned up includes based on include-what-you-use

* mitigated include-what-you-use false positives
2022-09-16 07:15:49 +02:00
Oliver Stöneberg 1b4141cbe5
added more missing `sstream` includes () 2022-08-19 18:23:15 +02:00
Paul Fultz II c0f55a2b85
Fix 11142: FP nullPointer before assignment ()
* Fix 11142: FP nullPointer before assignment

* Format

* Use simpleMatch
2022-08-03 19:05:07 +02:00
chrchr-github 71f9a7269f
Add test for , , avoid duplicate warning ()
* Add test for , avoid duplicate warning

* Add test for 

* Fix test
2022-08-02 21:43:18 +02:00
chrchr-github 111f4e17da
Fix FP nullPointerArithmetic when adding 0 () 2022-06-03 13:11:54 +02:00
chrchr-github 112b1573c5
Fix FN constructing string from nullptr / FN unread variables ()
* Fix  FN constructing string from nullptr /  FN unread variables

* Format
2022-05-18 13:52:44 +02:00
Paul Fultz II 843f7893d6
Fix 11040: FP nullPointer after loop () 2022-05-05 06:55:02 +02:00
chrchr-github 0dc3cb6eba
Fix FP nullPointerRedundantCheck with static function pointer () 2022-04-26 17:25:56 +02:00
orbitcowboy aa7a1f25c1 Added regression test from Ticket #3929:comment18 2022-04-10 08:10:11 +02:00
Paul Fultz II 74667d1e2a
Fix 10418: false negative: knownConditionTrueFalse ()
* Improve handling inverted condition

* Fix tests

* Rename variables for clarity

* Add initial test

* Add another test

* Format

* Fix FP
2022-04-07 06:48:13 +02:00
chrchr-github ddb0a8bb0b
Fix missing varId with using namespace ()
* Fix  missing varId with using namespace

* Undo

* Fix test

* Limit namespace candidates, duplicateBranch

* rvalue ref

* Undo

* Undo

* Undo

* Format

* Fix condition
2022-02-27 09:03:24 +01:00
Paul Fultz II dbc80787e1
Fix 10821: FN: containerOutOfBounds ()
* Fix 10821: FN: containerOutOfBounds

* Format

* Fix cppcheck warning

* Add valueflow tests

* Format

* Fix some bugs

* Format
2022-02-25 05:53:51 +01:00
Oliver Stöneberg f32583e097
removed OVERRIDE and FINAL defines and use the keywords directly () 2022-02-10 23:02:24 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
chrchr-github dad64bfcc8
Fix FP shadowFunction with default destructor implementation / Tests for , , , , () 2022-02-02 19:30:49 +01:00
chrchr-github 69ee464dff
Fix test for () 2022-02-02 19:29:01 +01:00
Oliver Stöneberg 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use () 2022-01-27 19:03:20 +01:00
Paul Fultz II 9220c8175d
Remove todo assert () 2022-01-16 12:32:46 +01:00
Paul Fultz II 1682344a80
Fix 10678: FP nullPointerArithmeticRedundantCheck in while loop () 2022-01-04 21:19:45 +01:00
chrchr-github e6091cbe54
Add tests for , , , () 2021-12-20 13:12:19 +01:00
Paul Fultz II 5414814238
Fix 10649: False positive: wrong known value after reassignment () 2021-12-15 19:37:25 +01:00
orbitcowboy bca27bf7d2 Ticket , added regression test 2021-12-07 08:50:29 +01:00
Paul Fultz II 0be6e27231
Fix 10640: FN nullPointerRedundantCheck ()
* Fix 10640: FN nullPointerRedundantCheck

* Format
2021-12-06 20:06:48 +01:00
chrchr-github b6b2cf8283
Add tests, todo for , () 2021-12-02 17:28:31 +01:00
chrchr-github b4a60305f9
Add todo for () 2021-11-29 19:12:07 +01:00
chrchr-github ca311ebcdf
ASSERT() on calls to Tokenizer::tokenize() in test code () 2021-11-29 07:34:39 +01:00
Paul Fultz II 57f5b19b34
Fix 7812: False negative: return pointer of local variable ()
* Fix 7812: False negative: return pointer of local variable

* Format

* Add test case for 3029

* Format
2021-11-28 15:25:21 +01:00
Paul Fultz II 12e731ad49
Fix 10605: FP containerOutOfBounds with empty() check () 2021-11-25 22:34:00 +01: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
Paul Fultz II 9b6c7007d2
Fix 9870: False negative: null pointer after duplicate conditions () 2021-10-05 08:29:23 +02:00
Paul Fultz II 255dc0484a
Fix 10331: wrong conditional value after assignment+return () 2021-09-21 19:25:41 +02:00
chrchr-github 05acc13582
Shadow variables, const, rename function () 2021-09-15 20:28:58 +02:00
Paul Fultz II 2b7523e466
Regression test for 8742: False positive: ValueFlow regression () 2021-09-04 08:45:55 +02:00
Paul Fultz II 2ee880752f
Fix 10410: FP nullPointerRedundantCheck on if (a || b ) followed by if ( b ) () 2021-08-29 15:39:41 +02:00
chrchr-github b2852de456
Amend test cases for () 2021-08-26 19:37:04 +02:00
Paul Fultz II 8aa37218c2
Fix 10400: FP nullPointer - for loop condition () 2021-08-25 20:33:41 +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
orbitcowboy 7fc145d076 : Added a regression test 2021-08-22 20:17:18 +02:00
Paul Fultz II d30f42e0da
Fix FP when calling a function in a condition () 2021-08-21 18:52:11 +02:00
Paul Fultz II f81ddd2daa
Fix 10408: FP nullPointer on 'return x.release()' () 2021-08-15 07:43:50 +02:00
Paul Fultz II 69eaa9dfd9
Refactor: ConditionHandler cleanup () 2021-08-11 08:37:37 +02:00
orbitcowboy 0b36ece049 : Added another regression test 2021-08-08 10:55:10 +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
orbitcowboy 1be5bb8bbc Running astyle [ci skip] 2021-07-18 10:01:22 +02:00