Commit Graph

11290 Commits

Author SHA1 Message Date
chrchr-github cb5a50c6a7
Fix #10710 FN passedByValue with QString (#3696) 2022-01-18 20:17:05 +01:00
Paul Fultz II 7b793af451
Fix 10728: Crash in CheckStl::checkDereferenceInvalidIterator2 (#3721)
* Fix 10728: Crash in CheckStl::checkDereferenceInvalidIterator2

* Format
2022-01-18 14:48:02 +01:00
orbitcowboy b6c010c17e Added regression test for Ticket 7981. 2022-01-18 13:09:02 +01:00
chrchr-github c2fc4973ad
Fix #10515 False positive for explicit one-argument constructor if co… (#3718) 2022-01-17 20:51:23 +01:00
chrchr-github 9c56e7ea8d
Fix #6475 FN uninitialized variable usage not detected (#3700) 2022-01-17 20:35:30 +01:00
chrchr-github 605fd7cf98
Fix #10146 FP functionConst (inconclusive) with nested members (#3719) 2022-01-17 20:33:32 +01:00
Paul Fultz II 7406dd8c94
Fix 10721: Crash in Tokenizer::simplifyTokenList1 (#3712) 2022-01-16 12:46:20 +01:00
Paul Fultz II abb0563cef
Fix 10726: Crash in CheckExceptionSafety::checkRethrowCopy (#3711) 2022-01-16 12:35:51 +01:00
Paul Fultz II 89bc226738
Fix 10718: Crash in CheckOther::checkDuplicateExpression (#3713) 2022-01-16 12:34:20 +01:00
Paul Fultz II 4af98f21d6
Fix 10588: crash (#3691) 2022-01-16 12:33:31 +01:00
Paul Fultz II 9220c8175d
Remove todo assert (#3714) 2022-01-16 12:32:46 +01:00
Paul Fultz II 55ff010df3
Fix 10717: Crash in SymbolDatabase::setValueTypeInTokenList (#3710)
* Fix 10717: Crash in SymbolDatabase::setValueTypeInTokenList

* Format
2022-01-15 07:56:56 +01:00
Paul Fultz II 0b1cd8626d
Fix 10664: Crash in Token::linkAt (#3708)
* Fix 10664: Crash in Token::linkAt

* Format
2022-01-14 23:51:01 +01:00
Paul Fultz II 2b6a89e30e
Fix 10716: Crash in CheckStl::checkDereferenceInvalidIterator2 (#3709)
* Fix 10716: Crash in CheckStl::checkDereferenceInvalidIterator2

* Format
2022-01-14 23:50:33 +01:00
chrchr-github 781a145680
Fix regression: functionStatic related to overload resolution (#3705) 2022-01-14 17:55:50 +01:00
chrchr-github 12abf85d1d
Add test case for #5777, use TODO_ASSERT, enable test case (#3703)
* Add test case for #5777, use TODO_ASSERT, enable test case

* Comment
2022-01-13 19:52:02 +01:00
Armin Müller 5a05631c84
Typos found by running "codespell" (#3702) 2022-01-13 17:24:26 +01:00
chrchr-github 95dc05b21d
Fix #7732 false negative: (style) Unused variable: std::pair (#3695) 2022-01-13 08:05:05 +01:00
chrchr-github af0a585a70
Partial fix for #9157 False negative: stlOutOfBounds, cast (#3699) 2022-01-13 08:03:24 +01:00
Maurice Gilden 44b182c9a7
Improve definitions for googletest ASSERT_* macros (#3694)
This avoids assertWithSideEffect and follows more closely what the real macros
are doing, similar to the ones in boost.cfg and cppunit.cfg.
2022-01-12 22:09:17 +01:00
chrchr-github 7aa0ec3e95
Fix regression: unreadVariable for trivial initialization (#3698) 2022-01-12 22:06:03 +01:00
chrchr-github 1b89c998f5
Fix #10469 FP returnTempReference with overloaded operator+= (#3678) 2022-01-12 22:05:30 +01:00
Paul Fultz II fa651272f0
Fix 10001: Syntax error on valid C++ code (#3697) 2022-01-12 22:04:28 +01:00
chrchr-github e4c8798974
Fix #10556 FP containerOutOfBounds with QList [inconclusive] (#3688) 2022-01-12 22:03:57 +01:00
chrchr-github 1670805a8d
Fix #10490 FP unreadVariable with std::shared_lock (#3672) 2022-01-10 07:43:02 +01:00
chrchr-github df3da38483
Fix #10682 Unused QString / #10686 unused std::array / #10005 unused variable with c++11 braced initializer not detected (#3684) 2022-01-10 07:36:49 +01:00
Paul Fultz II 4ef20f8f1e
Fix 10683: FP danglingTemporaryLifetime with pointer to vector (#3685) 2022-01-10 07:34:26 +01:00
Paul Fultz II fe7595cd9d
Fix 10677: crash during valueFlowInferCondition (#3687) 2022-01-09 22:43:08 +01:00
orbitcowboy 4a3a287248 Improved test case for ticket 1586 2022-01-08 18:39:19 +01:00
orbitcowboy 89e60af516 Ticket #1586 - Added regression test 2022-01-08 17:45:45 +01:00
Paul Fultz II 0c9eb5d190
Fix 10681: FP ctuuninitvar with array member (#3686) 2022-01-08 10:47:28 +01:00
chrchr-github 635c09643d
Add tests for #8498, #9887 (#3680) 2022-01-07 12:34:57 +01:00
shaneasd 8f7996211b
remove nullScope from TestSymbolDatabase (#3679) 2022-01-06 15:23:43 +01:00
chrchr-github 9fda86eb6d
Fix #9998 (#3676) 2022-01-06 15:21:05 +01:00
chrchr-github 6c55f9cf88
Add test for #10133 (#3675) 2022-01-06 15:19:10 +01:00
Paul Fultz II 1682344a80
Fix 10678: FP nullPointerArithmeticRedundantCheck in while loop (#3674) 2022-01-04 21:19:45 +01:00
chrchr-github fe077fc141
Add test for #10312 (#3673) 2022-01-04 20:50:00 +01:00
Oliver Stöneberg 0ba9cb4e64
fixed some unusedFunction warnings (#3618) 2022-01-04 15:48:08 +01:00
chrchr-github c05e2cc6c4
Fix #10154 False positive: objectIndex (#3666) 2022-01-04 10:37:16 +01:00
Paul Fultz II 119ec0582a
Fix 10676: FP: Array index -1 is out of bounds. (#3670) 2022-01-04 10:21:54 +01:00
Daniel Marjamäki 3524a0a3eb exprengine: reduce max buffer size to int_max 2022-01-03 20:55:46 +01:00
Daniel Marjamäki 33305ef4ec exprengine: better checking for uninit variables 2022-01-03 12:47:13 +01:00
Oliver Stöneberg 6739995e79
removed or annotated some code which is only used in test code (#3656) 2022-01-03 12:40:20 +01:00
Paul Fultz II 01a8890d6d
Fix 9760: False positive: constParameter on parameter used to take non-const pointer via array decaying (#3660) 2022-01-02 08:15:38 +01:00
Paul Fultz II 71a44395c8
Fix 10659: FP knownConditionTrueFalse - C++17 structured binding (#3662) 2022-01-02 08:14:50 +01:00
KenPatrickLehrmann af289c8357
Handle (&foo)-> in isVariableChanged (#3624) 2022-01-02 08:14:10 +01:00
Armin Müller d5daba331f
Typos found by running "codespell" (#3659) 2022-01-02 08:12:08 +01:00
Paul Fultz II 50862d1ace
Fix 10665: Crash in ExpressionAnalyzer (#3661) 2022-01-02 08:09:23 +01:00
Paul Fultz II 4b04c86249
Add regression for 9917: false positive: bitwiseOnBoolean when lhs is non-boolean (#3664) 2022-01-02 08:08:28 +01:00
Paul Fultz II 0c952ca05d
Fix 10223: ValueFlow; known value for a volatile variable (#3658) 2022-01-01 23:15:14 +01:00
Paul Fultz II 7bf0ca8d00
Fix 10672: crash: CheckAutoVariables (#3657) 2022-01-01 00:14:36 +01:00
chrchr-github 922e27de4c
Fix #7754 FP Same expression on both sides of '||' (#3635) 2021-12-31 08:24:05 +01:00
Rikard Falkeborn 8537331ad6
AutovarDeallocation: Fix grammar in error message (#3654) 2021-12-23 20:09:55 +01:00
Paul Fultz II d36aa590cd
Fix 10553: FP uninitvar with strcpy (#3652) 2021-12-23 08:22:41 +01:00
Daniel Marjamäki e6ccf299b9 Fixed #10598 (SymbolDatabase: final class is not parsed properly) 2021-12-22 21:48:01 +01:00
Chris Lalancette df1d6cf026
Fix the ability to recognize return types when simplifying attributes. (#3637)
* Fix the ability to recognize return types when simplifying attributes.

When parsing attributes to remove them, we have to allow for
the case where the return type of the function that follows
the attribute has a namespaced C++ type, like foo::bar .
That means that :: has to be recognized as a valid token.
Fix this in simplifyAttribute, and add tests for this as well.
2021-12-22 19:02:38 +01:00
chrchr-github 5a95ece15e
#10591: add TODO (#3647) 2021-12-21 10:24:38 +01:00
chrchr-github ca4e5ac527
Fix #7038 false negative for string argument in the CheckIO (#3649) 2021-12-20 17:22:39 +01:00
chrchr-github e6091cbe54
Add tests for #4647, #5979, #8763, #10101 (#3648) 2021-12-20 13:12:19 +01:00
Paul Fultz II 73f24b43f9
Fix 10437: FP knownConditionTrueFalse after pointer check (#3646) 2021-12-20 07:28:40 +01:00
orbitcowboy b2d81f0870 Ticket #8640: Added regression test 2021-12-19 17:43:32 +01:00
Paul Fultz II d69257e8cd
Fix 9740: FP accessMoved related to designated initialization (#3644) 2021-12-19 12:36:48 +01:00
Oliver Stöneberg cc24d6fcef
Fix #9162 (Invalid --project files do not give any error) (#3177) 2021-12-19 12:36:11 +01:00
chrchr-github bb327be8e8
Fix #10591 FP unusedStructMember with value-initialized struct and typedef (#3643) 2021-12-18 22:55:52 +01:00
chrchr-github 8df25ec4e9
Fix #8266 identicalConditionAfterEarlyExit variable modified in if-clause (#3610) 2021-12-18 22:52:54 +01:00
Paul Fultz II 332f4c205a
Fix 9772: FP uninitvar: in cppcheck 2.1 (#3638) 2021-12-17 21:51:47 +01:00
Paul Fultz II e7db974606
Fix 10621: FP arrayIndexOutOfBoundsCond with multiple index checks (#3640) 2021-12-17 21:48:29 +01:00
Paul Fultz II 4fb43a3f56
Fix 10643: FP: (error) Array 'buf[64]' accessed at index -1, which is out of bounds. (#3639)
* Fix 10643: FP: (error) Array 'buf[64]' accessed at index -1, which is out of bounds.

* Format
2021-12-17 10:05:57 +01:00
Paul Fultz II 398fa28021
Fix 10657: False positive; ValueFlow - invalid iterator (#3636) 2021-12-16 22:34:51 +01:00
Paul Fultz II ac4f4258a0
Fix 10651: Crash on static template method (#3633) 2021-12-16 22:32:44 +01:00
Oliver Stöneberg ba402f3e50
cleaned up includes based on include-what-you-use (#3627) 2021-12-15 19:47:27 +01:00
Paul Fultz II 5414814238
Fix 10649: False positive: wrong known value after reassignment (#3631) 2021-12-15 19:37:25 +01:00
Paul Fultz II 16110b6157
Fix 10339: Lambda in leads to analysis fail (#3629) 2021-12-15 19:34:18 +01:00
Paul Fultz II 5f73af0d0e
Fix 10625: False positive: known value below do while (#3623) 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 (#3630) 2021-12-15 19:31:28 +01:00
chrchr-github 532477cdb2
Fix #9549 FP knownConditionTrueFalse (bitshift) (#3616) 2021-12-14 07:30:57 +01:00
Paul Fultz II cb2738a60c
Fix 10645: FP knownEmptyContainer after conditional return (#3620) 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 #9342 FP oppositeExpression - negated value is not opposite for bitwise logical operators (#3615) 2021-12-10 18:06:45 +01:00
Rikard Falkeborn e7b6920cf4
Fix #10600: FP invalid dealloc of function array argument (#3613)
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 #6098, added regression test 2021-12-07 08:50:29 +01:00
chrchr-github 33c55f77a8
Fix #9570 (#3608) 2021-12-07 07:44:07 +01:00
Paul Fultz II 3874c546cc
Fix 10641: FP invalidLifetime with compiler-generated constructor (#3609) 2021-12-07 07:43:25 +01:00
Paul Fultz II 0be6e27231
Fix 10640: FN nullPointerRedundantCheck (#3607)
* Fix 10640: FN nullPointerRedundantCheck

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

* Format

* Fix incorrect addition
2021-12-06 09:16:42 +01:00
orbitcowboy 97f84a368d Ticket #8648: Added regression test. 2021-12-05 17:44:57 +01:00
Rikard Falkeborn 1a50146745
autovarInvalidDeallocation: Fix fp with impossible value (#3604)
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 (#3603) 2021-12-05 15:46:52 +01:00
Paul Fultz II c0af66bb52
Fix 10552: Internal error with unusedFunction (#3600) 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. (#3602) 2021-12-04 17:03:02 +01:00
Paul Fultz II a03e731930
Track lifetimes of lambdas that capture the 'this' variable (#3594) 2021-12-04 17:00:55 +01:00
Paul Fultz II 29dbded4af
Fix 10615: Crash in Token::linkAt (#3599) 2021-12-04 12:57:59 +01:00
Paul Fultz II bc31419da0
Fix 9301: Syntax error when specializing template variable array (#3601) 2021-12-04 12:56:25 +01:00
Paul Fultz II 8dcea26c10
Find iterator mismatch when using temporary containers (#3579) 2021-12-04 12:55:56 +01:00
Paul Fultz II c14920218c
Fix 10624: FP knownConditionTrueFalse with pointer member and dynamic cast (#3598) 2021-12-04 08:54:24 +01:00
Paul Fultz II a0d633945e
Fix 10621: FP arrayIndexOutOfBoundsCond with multiple index checks (#3597)
* Fix 10621: FP arrayIndexOutOfBoundsCond with multiple index checks

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

* Typo
2021-12-01 09:51:48 +01:00
Rikard Falkeborn db4f94fdfe
Fix #7341: Dealloc string literal (#3586) 2021-11-30 07:31:28 +01:00