Commit Graph

11170 Commits

Author SHA1 Message Date
Oliver Stöneberg ba402f3e50
cleaned up includes based on include-what-you-use () 2021-12-15 19:47:27 +01:00
Paul Fultz II 5414814238
Fix 10649: False positive: wrong known value after reassignment () 2021-12-15 19:37:25 +01:00
Paul Fultz II 16110b6157
Fix 10339: Lambda in leads to analysis fail () 2021-12-15 19:34:18 +01:00
Paul Fultz II 5f73af0d0e
Fix 10625: False positive: known value below do while () 2021-12-15 19:32:14 +01:00
Paul Fultz II 6681576707
Fix 10642: False positive: Possible dereference of an invalid iterator: v.begin()+v.size()-1 () 2021-12-15 19:31:28 +01:00
chrchr-github 532477cdb2
Fix FP knownConditionTrueFalse (bitshift) () 2021-12-14 07:30:57 +01:00
Paul Fultz II cb2738a60c
Fix 10645: FP knownEmptyContainer after conditional return () 2021-12-14 07:22:57 +01:00
Daniel Marjamäki 77434d093e SymbolDatabase: Do not set wrong type for std::map etc items in range for loop 2021-12-11 15:16:54 +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
Rikard Falkeborn e7b6920cf4
Fix : FP invalid dealloc of function array argument ()
Do not warn for array arguments that are free'd, since they decay to
pointers.
2021-12-09 07:16:40 +01:00
orbitcowboy bca27bf7d2 Ticket , added regression test 2021-12-07 08:50:29 +01:00
chrchr-github 33c55f77a8
Fix () 2021-12-07 07:44:07 +01:00
Paul Fultz II 3874c546cc
Fix 10641: FP invalidLifetime with compiler-generated constructor () 2021-12-07 07:43:25 +01:00
Paul Fultz II 0be6e27231
Fix 10640: FN nullPointerRedundantCheck ()
* Fix 10640: FN nullPointerRedundantCheck

* Format
2021-12-06 20:06:48 +01:00
Paul Fultz II d2926bfa96
ValueFlow: Propagate const variables more aggressively ()
* ValueFlow: Propagate const variables more aggressively

* Format

* Fix incorrect addition
2021-12-06 09:16:42 +01:00
orbitcowboy 97f84a368d Ticket : Added regression test. 2021-12-05 17:44:57 +01:00
Rikard Falkeborn 1a50146745
autovarInvalidDeallocation: Fix fp with impossible value ()
daca reports new false positives after db4f94fdfe on the form:

	void f() {
	    char *ptr = malloc(10);
	    char *empty_str = "";
	    if (ptr == NULL)
	        ptr = empty_str;
	    if (ptr != empty_str)
	        free(ptr);
	}

Add a check that the value is not impossible to avoid this.
2021-12-05 15:47:21 +01:00
Paul Fultz II f64bcac004
Fix 10429: Regression: invalidIterator () 2021-12-05 15:46:52 +01:00
Paul Fultz II c0af66bb52
Fix 10552: Internal error with unusedFunction () 2021-12-05 15:46:17 +01:00
Paul Fultz II 35f14962fc
Regression test for 9523: Syntax Error: AST broken, 'if' doesn't have two operands. () 2021-12-04 17:03:02 +01:00
Paul Fultz II a03e731930
Track lifetimes of lambdas that capture the 'this' variable () 2021-12-04 17:00:55 +01:00
Paul Fultz II 29dbded4af
Fix 10615: Crash in Token::linkAt () 2021-12-04 12:57:59 +01:00
Paul Fultz II bc31419da0
Fix 9301: Syntax error when specializing template variable array () 2021-12-04 12:56:25 +01:00
Paul Fultz II 8dcea26c10
Find iterator mismatch when using temporary containers () 2021-12-04 12:55:56 +01:00
Paul Fultz II c14920218c
Fix 10624: FP knownConditionTrueFalse with pointer member and dynamic cast () 2021-12-04 08:54:24 +01:00
Paul Fultz II a0d633945e
Fix 10621: FP arrayIndexOutOfBoundsCond with multiple index checks ()
* Fix 10621: FP arrayIndexOutOfBoundsCond with multiple index checks

* Format
2021-12-04 08:54:04 +01:00
chrchr-github b6b2cf8283
Add tests, todo for , () 2021-12-02 17:28:31 +01:00
chrchr-github 6f2000a99b
Add test for () 2021-12-01 18:24:25 +01:00
chrchr-github 4a1a1534df
Fix (FN charset in format string) ()
* Fix 

* Typo
2021-12-01 09:51:48 +01:00
Rikard Falkeborn db4f94fdfe
Fix : Dealloc string literal () 2021-11-30 07:31:28 +01:00
chrchr-github d565cde815
Fix and tests for , , ()
* Add test cases for , 

* Fix 

* Format
2021-11-29 22:51:35 +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 853a1f6d54
Fix 10631: FP, Regression: error: Return value of allocation function 'makeThing' is not stored. () 2021-11-29 07:06:43 +01:00
Daniel Marjamäki c26e205e29 clang import: fixed problem with nameless struct 2021-11-29 07:00:18 +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
chrchr-github cea649761c
Fix FN buffer overrun with array of pointers () 2021-11-27 12:15:36 +01:00
Paul Fultz II 1e327dfbd3
Fix 9836: False negative: No invalidContainer when using vector of vectors ()
* Fix 9836: False negative: No invalidContainer when using vector of vectors

* Format
2021-11-26 13:38:40 +01:00
Paul Fultz II 143ddf2758
Fix 10595: FN: std::vector() reserve() ()
* Fix 10595: FN: std::vector() reserve()

* Format
2021-11-26 09:50:02 +01:00
Paul Fultz II 12e731ad49
Fix 10605: FP containerOutOfBounds with empty() check () 2021-11-25 22:34:00 +01:00
Paul Fultz II 33ad30f4da
Fix 10617, 9824: conditions in expanded macro () 2021-11-25 18:40:15 +01:00
Rikard Falkeborn 085d25f1b1
SymbolDatabase: Fix valuetype with constexpr and auto () 2021-11-24 16:51:40 +01:00
chrchr-github a6b8339990
Add test for ()
* Add test for 

* Format
2021-11-24 14:42:19 +01:00
chrchr-github ed050659a3
Add test cases, todos for , , ()
* Add test cases, todos

* Format

* Remove dupes

* Format
2021-11-23 23:07:15 +01:00
Paul Fultz II b80e24231b
Fix 10604: FP mismatchingContainerIterator with container member () 2021-11-23 22:50:32 +01:00
Daniel Marjamäki c7ef602cd6 Fixed (False positive: constParameter on parameter used by non-const call via pointer to member function) 2021-11-21 20:03:38 +01:00
chrchr-github cdc34fe92f
Add test for () 2021-11-20 08:53:18 +01:00
chrchr-github b211139dbd
Add test for () 2021-11-20 08:52:51 +01:00
chrchr-github 194a1be2c6
Add test for () 2021-11-20 08:52:27 +01:00
chrchr-github 22eeeed17a
Add test for ()
* Add test for 

* Format
2021-11-18 20:25:21 +01:00