Commit Graph

990 Commits

Author SHA1 Message Date
Paul Fultz II 7f358b2bed
Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
Paul Fultz II 735f716603
Fix 10394 and 10395: FP knownConditionTrueFalse: loop variable (#3381) 2021-08-04 21:07:55 +02:00
Paul Fultz II 8b8ae55490
Fix 10129: false negative: knownConditionTrueFalse (#3382)
* 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
Paul Fultz II 4626f9ed76
Fix FP when returning a pointer to a container (#3379) 2021-08-04 08:16:31 +02:00
Paul Fultz II 6736ac7e3a
Revert "Formatted the code [ci skip]" (#3380)
This reverts commit 7a6d7f7c2d.
2021-08-03 17:53:30 +02:00
orbitcowboy 7a6d7f7c2d Formatted the code [ci skip] 2021-08-03 06:33:54 +02:00
Paul Fultz II 08041e3a0b
Refactor: Assert an expression has an id and fix assertion failures (#3377)
* Fix 10390: FP: knownConditionTrueFalse

* Assert expression has an ID

* Fix assertion errors

* Format
2021-08-03 06:31:52 +02:00
Paul Fultz II 7be9b217e6
Fix 7843 and 7844: ValueFlow for abs (#3373)
* Refactor: Use valueFlowForward to forward values in condition expression

* Formattting

* Make known when using bools as well

* Set abs function as always positive

* Add test

* Add valueFlowSymbolicAbs

* Set impossible values

* Fix test case

* Fix error messages

* Merge
2021-08-03 06:31:28 +02:00
Paul Fultz II 3d19b33c3e
Fix 9948 and 10234: false negative: knownConditionTrueFalse and stlOutOfBounds (#3372) 2021-08-02 10:51:34 +02:00
Paul Fultz II 61ceff39f5
Fix 10390: FP: knownConditionTrueFalse (#3374) 2021-08-02 10:49:39 +02:00
Daniel Marjamäki 1ec7397c21 astyle formatting
[ci skip]
2021-08-01 14:05:30 +02:00
Paul Fultz II 2f6a6e4b45
Refactor: Use valueFlowForward to forward values in condition expression (#3369) 2021-08-01 10:13:14 +02:00
Paul Fultz II 7d9fdf582b
Fix 10121: False positive: Condition 'ab->a!=123' is always false when modifying an alias (#3293) 2021-08-01 10:10:11 +02:00
Paul Fultz II 6767b57d4c
Fix FP for symbolic values when the expression is not const (#3370) 2021-07-31 14:19:37 +02:00
Paul Fultz II 3a7ba3cd29
Add symbolic values to ValueFlow (#3367) 2021-07-30 21:29:35 +02:00
Paul Fultz II 6a81b4c17c
Fix 10264: FP invalidContainer when address of container is passed inside struct (#3368) 2021-07-30 15:52:00 +02:00
Paul Fultz II 737b6199ba
Refactor: Allow parse to return multiple values for a condition (#3361) 2021-07-26 22:23:19 +02:00
Paul Fultz II c34691ff56
Fix 10354: FP knownConditionTrueFalse after bitwise and/xor (#3360) 2021-07-26 22:22:50 +02:00
Paul Fultz II 84ea0a2295
Refactor: Remove extra analysis of container sizes in conditions (#3357) 2021-07-25 18:14:51 +02:00
Paul Fultz II 5be3f700bb
Fix 10373: ValueFlow: container in struct assumed empty (#3355) 2021-07-25 18:13:55 +02:00
Paul Fultz II 8e416a7255
Fix issue 10379: FP knownConditionTrueFalse with mod operator (#3354) 2021-07-25 18:13:14 +02:00
Paul Fultz II 00eb71fd49
Remove constexpr -> const simplification (#3346) 2021-07-22 07:22:26 +02:00
Paul Fultz II 8efe1d4ab4
Find reference to dangling unique ptr (#3344) 2021-07-20 21:30:27 +02:00
Daniel Marjamäki dd34d1c123 CI; Fix Cppcheck self-check, pointer can be const 2021-07-20 11:21:47 +02:00
orbitcowboy 1be5bb8bbc Running astyle [ci skip] 2021-07-18 10:01:22 +02:00
Paul Fultz II 59a1c1a9d8
Refactor: Remove variable analyzer (#3339) 2021-07-18 07:46:31 +02:00
orbitcowboy 3f1e937ea1 Running astyle [ci skip] 2021-07-17 08:19:04 +02:00
chrchr-github 8cd8b9c64e
Fix MSVC build and some warnings (#3334) 2021-07-16 21:55:12 +02:00
Paul Fultz II 942202aede
Evaluate container sizes in forward analysis (#3338) 2021-07-16 18:49:07 +02:00
Daniel Marjamäki 56924643be Fixed #10347 (ValueFlow: No known value set for sizeof(a[0])) 2021-07-08 18:18:44 +02:00
Armin Müller fc90598077
Typos found by running "codespell" (#3324) 2021-07-02 17:41:51 +02:00
Daniel Marjamäki 1a5449cbeb Fixed #10327 (ValueFlow; Wrong Uninit value in called function) 2021-07-01 22:08:00 +02:00
Daniel Marjamäki 2a2e071a85 Tokenizer::simplifyAttribute; Set function attribute for function pointer 2021-06-26 14:23:39 +02:00
Paul Fultz II 66956ed959
Fix 10323: Wrong known value. x!=0 does not mean that x==1 (#3308) 2021-06-26 09:16:45 +02:00
Paul Fultz II 508188df2b
Fix 10297: Regression; ValueFlow known value, sign conversion (#3307) 2021-06-26 09:16:04 +02:00
Daniel Marjamäki 769b20b426 ValueFlow: Clarify note when impossible value is assigned (#10297) 2021-06-24 17:10:06 +02:00
Daniel Marjamäki 2d08564c8a astyle formatting 2021-06-19 14:47:35 +02:00
Paul Fultz II dd178c3ad9
Fix 10314: Possible nullPointerRedundantCheck false positive (#3298) 2021-06-19 13:59:48 +02:00
Paul Fultz II f55a4563f9
Fix 10308: danglingTemporaryLifetime confused by function parameter (#3292) 2021-06-09 09:21:03 +02:00
Paul Fultz II f3a33ea330
Fix 10294: ValueFlow: Wrong <Uninit> value below loop (#3291) 2021-06-09 09:20:43 +02:00
orbitcowboy 195d413986 Running astyle [ci skip] 2021-06-05 08:53:15 +02:00
Paul Fultz II f90b05ea7c
Show lifetime kind in output (#3285) 2021-06-04 21:41:30 +02:00
Paul Fultz II 668b88d7c0
Fix 10284: False positive; valueFlowBeforeCondition does not seem to care about increment (#3287) 2021-06-04 21:40:57 +02:00
Paul Fultz II a14922ed85
Fix 10238: FP knownConditionTrueFalse std::string from const char* assumed non-empty (#3288) 2021-06-04 17:22:05 +02:00
Paul Fultz II 537fb5bcd9
Fix 10264: FP invalidContainer when address of container is passed inside struct (#3286) 2021-06-04 17:20:47 +02:00
Paul Fultz II 486e440c4a
Fix 10298: ValueFlow: Wrong known value, 'x == -1' implicit unsigned cast for rhs (#3277) 2021-06-04 17:17:41 +02:00
Paul Fultz II 95c872b1ec
Fix todo test for returning a dangling reference (#3284) 2021-06-04 17:15:39 +02:00
Paul Fultz II 548ec10824
Fix issue 10306: FP knownConditionTrueFalse with modulo result converted to bool (#3282) 2021-06-03 07:26:36 +02:00
Paul Fultz II ab50a75d8a
Fix 10289: ValueFlow; Wrong known value 'size_t - uint16_t > 0' (#3273) 2021-05-24 08:28:21 +02:00
Paul Fultz II 47a4144b47
Fix 10288: ValueFlow; False positives because of wrong known value when there is sign cast (#3268) 2021-05-23 10:20:29 +02:00