Commit Graph

240 Commits

Author SHA1 Message Date
chrchr-github c7cd091a93
Fix #12141 debug: simplifyUsing: unmatched body end (#5620) 2024-01-05 14:11:41 +01:00
chrchr-github f9134a69d2
CheckLeakAutoVar: fix crash on unknown macro (#5836) 2024-01-05 13:24:01 +01:00
chrchr-github 1eee68f039
Fix FN deallocuse with function call (refs #11409) (#5822) 2024-01-04 22:10:24 +01:00
chrchr-github a7baf88d4f
Fix #12289 FN (regression): memory leak not shown when strcpy is used (#5809) 2023-12-24 14:42:07 +01:00
chrchr-github 17ee4093fa
Fix #10905, #11665 FN deallocuse (#5751) 2023-12-23 11:31:27 +01:00
chrchr-github 41e6c87cb2
Fix #12236 FP related to decltype/__typeof__ (#5717) 2023-12-04 11:19:49 +01:00
chrchr-github ae27b613ae
Fix #12239 FP memleak when passing this in allocation (#5719) 2023-12-02 14:15:10 +01:00
chrchr-github d6a1a657df
Fix #11796 FN memleak with brace init (#5708)
Co-authored-by: chrchr-github <chrchr@github>
2023-12-01 15:39:16 +01:00
chrchr-github d7c7a39afe
Fix crash in CheckLeakAutoVar (f'up to #12186) (#5683) 2023-11-20 18:26:05 +01:00
chrchr-github 63a5a71c20
Fix #12186 FN memleak with outparam allocation (#5661) 2023-11-16 15:23:40 +01:00
chrchr-github 85172fe770
Don't report checkLibraryUseIgnore for known functions (refs #7719) (#5664) 2023-11-16 14:23:08 +01:00
Oliver Stöneberg 63e00ea918
fixed some "Variable can be made constexpr" Rider warnings (#5615) 2023-11-03 09:55:44 +01:00
chrchr-github efd488b519
Partial fix for #12062 FN: memleak (#5548) 2023-10-13 18:47:06 +02:00
Oliver Stöneberg 06b5ef1e4d
cleaned up includes based on include-what-you-use (#5532) 2023-10-09 10:07:20 +02:00
Oliver Stöneberg 960e8bb4ea
testrunner: got rid of some redundant preprocessing code / added some missing asserts (#5521)
This consolidates the stray invocations of preprocessing.
2023-10-08 11:29:52 +02:00
Oliver Stöneberg 3979ade9ea
got rid of test-only `Library` functions / avoid some more direct modifications of library data structures in test (#5468) 2023-09-25 13:37:24 +02:00
chrchr-github f9b18bc9d8
Fix FP (regression): Resource handle 'fd' freed twice. [doubleFree] (#5424) 2023-09-10 20:32:55 +02:00
Oliver Stöneberg c068c74e86
CI-mingw.yml: use pre-installed MinGW / also use `lld` and `ccache` for faster builds (#4400)
This used to be one of the longest running jobs because of the slow
setup and linking. Now it will take only ~2 minutes if everything is
cached with half the time taken up by the tests.
2023-09-04 13:56:18 +02:00
Oliver Stöneberg bfb50ca9d8
removed unnecessary `Settings` parameter from `Check::runChecks()` and made `Tokenizer` a reference (#5308)
There was no need for the `Tokenizer` parameter to be a pointer as it
could never be `nullptr` and was also dereferenced without checking
first.

As a reference to the `Settings` was already available via the
`Tokenizer` there was no need to pass it separately. In the production
code there will only be one instance of it but in the tests we could
have accidentally passed a different one.
2023-08-18 12:03:50 +02:00
Oliver Stöneberg 2502897265
avoid some redundant and unused settings in tests among other cleanups / added and used `WARN_UNUSED` attribute (#5284) 2023-08-09 12:43:55 +02:00
Oliver Stöneberg 45de338f1b
cleaned up includes based on include-what-you-use / iwyu.yml: updated to yet another distro to get the latest version and updated the Chaotic-AUR key (#5267)
This is a mess. The version is AUR is still outdated and also doesn't
install anymore. Fedora 38 carries the latest version of it so use that
now. Keep the old steps in case we need to switch again in the future.
2023-08-02 10:36:17 +02:00
chrchr-github 55581fc2e9
Fix FP deallocuse (#5183) 2023-06-23 18:21:53 +02:00
chrchr-github b80460f3ae
Fix #11786 False positive: memory leak (#5182) 2023-06-22 23:03:55 +02:00
chrchr-github fe56b0c42a
LeakAutoVar: Handle C++ casts in function calls (#5181) 2023-06-22 16:01:21 +02:00
chrchr-github 457e0ce0c8 Partial fix for #11189 checkLibraryNoReturn with std::function parameter 2023-06-13 21:48:16 +02:00
Anton Lindqvist 09cd3a8269
Fix FP deallocuse regression (#5144)
Introduced in commit 69116c838 ("Fix #11758 Regression: memleak / Fix #11746 FN:
deallocuse (#5139)").
2023-06-11 14:11:41 +02:00
chrchr-github 69116c8386
Fix #11758 Regression: memleak / Fix #11746 FN: deallocuse (#5139)
* Fix #11758 Regression: memleak

* Format

* Fix #11746 FN: deallocuse

* Complete the trifecta
2023-06-10 00:24:36 +02:00
orbitcowboy 6ea88c2758
Added test case from #8302 (#5138)
* Added test case from #8302 and a TODO

* Check with in C++ mode to get rid of TODO.

* Updated expected error message text

* Updated expected error message text
2023-06-09 21:46:45 +02:00
chrchr-github be2824b003
Fix FN deallocuse with array access (#5121)
* Fix FN deallocuse with array access

* Fix another FN

* Undo
2023-06-08 07:55:49 +02:00
chrchr-github 52c0f10fa1
Fix FP mismatchAllocDealloc, uninitdata for new with initializer (#5106) 2023-06-02 13:01:55 +02:00
orbitcowboy 9810bad869
#9708 (doublefree) - Added a regression test (#5109) 2023-06-02 10:32:33 +02:00
chrchr-github 774123d28d
Remove hardcoded lists of functions/templates/types (#5069)
* Remove hardcoded list of functions

* Remove hardcoded list of templates

* Remove hardcoded list of types

* Format

* Fix test

* Unused variable

* Add tests

* auto -> int
2023-05-28 14:33:41 +02:00
chrchr-github 6d2662b8a2
Fix #4400 FN (error) Memory leak - assignment to reference of a pointer (#5048)
* Fix #4400 false negative: (error) Memory leak - assignment to reference of a pointer

* Comment

* Run tests as C++

* Add TODOs

* Bail out for local references
2023-05-23 06:29:20 +02:00
chrchr-github 8eabf5c211
Fix #8433 FN unused variable not detected when there is lambda (#5060)
* Fix #8433 FN unused variable not detected when there is lambda

* Format

* Fix tests

* Check lambda return

* Add test

* Undo, add test

* simpleMatch()

* Rename test
2023-05-22 07:39:57 +02:00
chrchr-github ba57e15cb2
Fix #11717 Warn when C++ code is scanned as C (prevent FPs) (#5064)
* Fix #11717 Warn when C++ code is scanned as C (prevent FPs)

* Don't throw for operators

* Detect reference variables

* Fix tests

* Fix compilation

* Fix test

* Fix another test

* Use strAt()
2023-05-21 13:59:49 +02:00
Oliver Stöneberg 5833fc3c19
testrunner: even more `SettingsBuilder` usage and `const` cleanups (#5030)
* moved some of the test-only `Library::loadxmldata()` calls into `test`

* testrunner: reduced need for backup/restore of settings
2023-05-04 10:31:05 +02:00
Oliver Stöneberg 25183ff484
testrunner: more `SettingsBuilder` usage and `const` cleanups (#5026) 2023-05-02 15:54:19 +02:00
Oliver Stöneberg 2935c855c3
reduced usage of mutable `Settings` objects in tests (#4798) 2023-05-02 11:48:24 +02:00
Oliver Stöneberg 5be8eee943
iwyu.yml: use a distro which has the latest `include-what-you-use` / enabled Qt mappings / cleaned up includes (#4885) 2023-04-08 16:08:47 +02:00
chrchr-github 1b00a0f06a
Fix #9279 Missing --check-library warning when memory leaks check assumes function is noreturn (#4937)
* Fix #9279 Missing --check-library warning when memory leaks check assumes function is noreturn

* Format

* Fix check, add tests

* Format
2023-04-06 18:44:03 +02:00
Oliver Stöneberg 50eb0641b9
iwyu.yml: added `clang-include-cleaner` job / cleaned up includes based on `include-what-you-use` (#4844) 2023-03-04 08:53:19 +01:00
Oliver Stöneberg bd1ae69b00
cleaned up includes based on `include-what-you-use` (#4599) 2023-03-02 21:50:14 +01:00
Oliver Stöneberg 3ec4da0f8a
improved library loading in tests (#4806) 2023-03-02 21:10:51 +01:00
chrchr-github d1e1f951df
Don't show checkLibraryNoReturn for functions with visible declaration (#11523, #11190) (#4809) 2023-02-24 06:49:28 +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
chrchr-github 3ccc0adbca
Fix #11182 checkLibraryFunction with overloaded method / #11198 inconsistent reporting of checkLibraryNoReturn (#4740) 2023-01-26 22:29:49 +01:00
Oliver Stöneberg fd15811215
de-coupled `--check-library` from `information` severity and other dependencies (#3861) 2023-01-26 22:28:04 +01:00
chrchr-github b7693ccc7a
Fix #11431 FP resourceLeak with goto (#4645) 2022-12-14 22:47:14 +01:00