Commit Graph

526 Commits

Author SHA1 Message Date
chrchr-github 938ad990f5
Add tests for #6925, #11042, #11494 (#4987)
* Add tests for #6925, #11042, #11494

* Format
2023-04-19 21:19:45 +02:00
Paul Fultz II cd21f55cdf
Fix 11630 and 11620 lifetime issues (#4913) 2023-03-24 13:29:43 +01:00
Paul Fultz II 8324caf8b9
Fix 11557: FP derefInvalidIteratorRedundantCheck in and/or condition (#4892) 2023-03-16 15:00:27 +01:00
chrchr-github a6c5bb28c1
Fix crash in LoopAnalyzer (#4888) 2023-03-13 15:44:34 +01:00
chrchr-github a75392307f
Partial fix for #11604: no DacaWrongData for function pointer (#4867) 2023-03-12 15:49:37 +01:00
Mateusz Michalak 2d5cabed4b
Add std::*begin and std::*end cfg (#4796) 2023-03-09 17:06:53 +01:00
Paul Fultz II 9351eddbca
Fix 11605: FN useStlAlgo with multiple conditions (#4873) 2023-03-09 17:06:27 +01:00
chrchr-github 9291421840
Fix #11595 FN useStlAlgorithm with complex condition (#4848) 2023-03-04 11:58:12 +01:00
Oliver Stöneberg bd1ae69b00
cleaned up includes based on `include-what-you-use` (#4599) 2023-03-02 21:50:14 +01:00
chrchr-github 50c8a0dbe1
Fix #11553 pop_back on empty container is UB (#4789) 2023-02-24 01:10:19 +01:00
chrchr-github 8af1026696
Set functions for calls through iterators (#4763) 2023-02-07 21:57:59 +01:00
chrchr-github 5818520b4b
Fix FN stlcstrAssignment (#4764) 2023-02-03 14:10:27 +01:00
Oliver Stöneberg 7c7ccdf7c0
Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Oliver Stöneberg 1d3955bd92
renamed some files in the `test` folder (#4705) 2023-01-27 08:18:32 +01:00
Paul Fultz II f8132ea022
Fix 11381: FP derefInvalidIteratorRedundantCheck when updating iterator using std::tie (#4659) 2022-12-20 20:29:19 +01:00
chrchr-github b1abaf8809
Fix FP useStlAlgorithm (don't suggest std::accumulate when nothing is accumulated) (#4647) 2022-12-18 16:52:04 +01:00
Paul Fultz II 3f88744851
Fix 11358: FP containerOutOfBounds for container passed by pointer (#4626) 2022-12-09 19:43:21 +01:00
Paul Fultz II 0cb742701d
Fix 11415: FP containerOutOfBounds for container initialized in virtual method (#4622) 2022-12-08 20:10:58 +01:00
chrchr-github 3273e51fd5
Fix #10412 FN useStlAlgorithm with iterators (#4157) 2022-10-16 13:46:26 +02:00
chrchr-github 586c29c772
Partial fix for #9157 False negative: stlOutOfBounds, cast (#4527)
* Fix leakNoVarFunctionCall FP

* Partial fix for #9157 False negative: stlOutOfBounds, cast
2022-09-30 14:43:21 +02:00
chrchr-github 32c7b919ba
Add tests for #1201, #2654, #6379 (#4518)
* Add test for #6541, avoid duplicate warning

* Add test for #5475

* Fix test

* Merge

* Add test for #8666

* Fix #11239 checkLibraryCheckType with asm goto() (invalid varid)

* Format

* Add tests for #1201, #2654

* Fix test

* Add test for #6379
2022-09-29 07:05:29 +02:00
Oliver Stöneberg b9e07e918e
enabled and fixed `readability-named-parameter` clang-tidy warnings (#4487) 2022-09-27 20:03:25 +02:00
Oliver Stöneberg b3ec225480
iwyu.yml: use `debian:unstable` to always get latest include-what-you-use / cleaned up includes (#4466)
* 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
chrchr-github 13e8d5220c
Fix another c_strParam regression (#4394) 2022-08-23 20:26:36 +02:00
chrchr-github 4be7f689d7
Fix c_strParam regression (#4393)
* Fix #7515 New check: Not needed c_str() operation

* Comment

* Detect more instances of c_str() misuse

* Fix bad merge

* Check for data() also

* Fix

* Format

* Format

* Fix c_strParam regression
2022-08-23 15:00:27 +02:00
chrchr-github 66fca7ba91
Detect more instances of c_str() misuse (#4392)
* Fix #7515 New check: Not needed c_str() operation

* Comment

* Detect more instances of c_str() misuse

* Fix bad merge

* Check for data() also

* Fix

* Format

* Format
2022-08-22 14:06:10 +02:00
chrchr-github d351a97a0f
Fix #8336 FN stlcstrParam (#4389)
* Fix #7515 New check: Not needed c_str() operation

* Comment

* Fix error messages

* Handle more complex string expressions

* Fix #8336 FN stlcstrParam

* Handle iterators

* Format

* Format

* Parentheses
2022-08-21 13:04:43 +02:00
chrchr-github b04bf7396f
Fix #7515 New check: Not needed c_str() operation (#4371) 2022-08-20 20:52:10 +02:00
Oliver Stöneberg 1b4141cbe5
added more missing `sstream` includes (#4384) 2022-08-19 18:23:15 +02:00
Paul Fultz II 6cb3a79a64
Fix 11147: FP invalidContainer with substr() (#4333)
* Fix 11147: FP invalidContainer with substr()

* Format
2022-08-03 19:04:44 +02:00
chrchr-github c878285a42
Add tests for #5804, #8958, #9002, #10031 (#4326) 2022-07-30 16:15:32 +02:00
chrchr-github 79f091c59a
Fix uselessCallsConstructor TODOs (#4299)
* Fix uselessCallsConstructor TODOs

* Format
2022-07-21 22:15:16 +02:00
chrchr-github 381c38b2f5
Improve check: uselessCallsConstructor (#4270) 2022-07-12 17:40:14 +02:00
chrchr-github 47c2a01392
Fix #11166 inefficient way to remove last character from std::string (#4267)
* Fix #11166 inefficient way to remove last character from std::string

* Format

* Modify message, add test

* Format

* Fix another warning
2022-07-11 23:07:37 +02:00
chrchr-github f9337b725b
Fix nullptr deref (#4262)
* Fix some FNs related to c_str()

* Format, fix FP

* Fix nullptr deref

* Fix merge
2022-07-11 22:58:08 +02:00
chrchr-github c218859418
Fix some FNs related to c_str() (#4258) 2022-07-10 11:38:01 +02:00
chrchr-github 60c1eef659
Fix FP containerOutOfBounds with std::map (#4230) 2022-06-23 20:26:47 +02:00
Paul Fultz II 9cecc8468e
Fix 10570: Improve check; condition then pointer dereference, different pointers (#4216)
* Try to use after assign in loop

* Update valueflow forward to handle init tokens

* Fix tests

* Make test TODO

* Format

* Add tests

* Format

* Fix ubsan error

* Use simpleMatch
2022-06-16 19:26:23 +02:00
Paul Fultz II 6d3208ecb0
Fix 11062: false positive: knownEmptyContainer (regression) (#4106)
* Fix 11062: false positive: knownEmptyContainer (regression)

* Format
2022-05-12 06:24:16 +02:00
Paul Fultz II 8d16ee946c
Fix 11027: False positive: containerOutOfBounds from condition in assert (#4084)
* Fix 11027: False positive: containerOutOfBounds from condition in assert

* Format
2022-05-05 06:54:44 +02:00
Paul Fultz II 5afd6880c3
Fix 11028: False positive: invalidContainer (#4083)
* Fix 11028: False positive: invalidContainer

* Format
2022-05-05 06:54:36 +02:00
Paul Fultz II 3e686103ae
Fix 10984: False positive: invalidContainer when explictly capturing vector by reference (#4064) 2022-04-30 09:36:28 +02:00
chrchr-github da1e2b22be
Add some tests (#4014)
* Test for #10454

* Test for #10493

* Test for #10069

* Test for #10228

* Fix test case
2022-04-13 12:25:53 +02:00
Paul Fultz II 61b87bcc60
Fix 10955: False positive: containerOutOfBounds when using a const reference member (#4005) 2022-04-12 08:07:55 +02:00
Paul Fultz II 09c8cfb2ae
Fix 6624: false negative: std::vector out of bounds access not detected (#3980)
* Fix 6624: false negative: std::vector out of bounds access not detected

* Format

* Add test for auto

* Fix tests

* Format
2022-04-07 06:47:15 +02:00
Paul Fultz II 1d92665ad2
Fix 10867: false negative: containerOutOfBounds with std::array (regression) (#3976)
* Fix 10867: false negative: containerOutOfBounds with std::array (regression)

* Format
2022-04-06 06:25:28 +02:00
chrchr-github cfbbeb4b1b
Partial fix for #10867 FN containerOutOfBounds with std::array (#3971)
* Partial fix for #10867 FN containerOutOfBounds with std::array

* Format

* Format

* Optimize
2022-04-05 07:34:20 +02:00
chrchr-github 190506db40
Fix #10737 Regression: unusedStructMember (#3894)
* Fix #10737 Regression: unusedStructMember

* Add test for #9161

* simpleMatch
2022-03-13 06:27:17 +01:00
chrchr-github 7f682d544e
Partial fix for #6615 FN buffer access out of bounds: std::vector (#3873)
* Fix #10779 FN: stlOutOfBounds (off by one)

* Format

* Simplify

* Partial fix for #6615 FN buffer access out of bounds: std::vector

* Undo

* Format

* Fix test case
2022-03-06 07:41:09 +01:00