Commit Graph

223 Commits

Author SHA1 Message Date
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
chrchr-github 9f50611a44
Fix #11391 FP doubleFree with goto (#4587) 2022-11-19 16:49:34 +01:00
chrchr-github 80aa6dc1d9
Fix #11392 FP mismatchAllocDealloc with std::unique_ptr and custom deleter (#4585) 2022-11-18 19:45:25 +01:00
Rikard Falkeborn 3c21b9cc53
Fix #11038, FP memory leak in if-statement in realloc with cast (#4572) 2022-11-03 10:37:43 +01: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 cf52ee098a
Fix checkLibraryFunction FPs (#4423)
* Fix checkLibraryFunction FPs

* Fix FP with fclose()

* Format

* Fix FP with reinterpret_cast
2022-09-02 07:51:10 +02:00
Oliver Stöneberg 1b4141cbe5
added more missing `sstream` includes (#4384) 2022-08-19 18:23:15 +02:00
chrchr-github d5a0dfda00
Fix #11239 checkLibraryCheckType with asm goto() (invalid varid), add test for #8666 (#4340)
* 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
2022-08-04 21:35:18 +02:00
chrchr-github dd927aab9b
Fix #11237 checkLibraryNoReturn with unassigned object (#4338)
* Handle float values

* Fix #11237 checkLibraryNoReturn with unassigned object
2022-08-03 19:04:10 +02:00
chrchr-github 304e448749
Fix #8476 --check-library reports missing configuration for static_assert (#4314) 2022-07-28 22:47:15 +02:00
chrchr-github 3fc276fb51
Add test for #11061 (#4307) 2022-07-26 11:14:35 +02:00
chrchr-github 479533a80a
Rework fix for #11008 (#4296) 2022-07-24 12:15:04 +02:00
chrchr-github 5e537a666f
Fix --check-library warning for int(i) (#4293) 2022-07-19 20:41:18 +02:00
chrchr-github c736fe8787
Fix #11008 FP doubleFree with pointer in struct (#4294) 2022-07-19 20:41:08 +02:00
chrchr-github 63e567eb50
Remove simplifyKnownVariables() (#4232)
* Remove simplifyKnownVariables()

* Add some test cases back

* Remove unused functions

* Format
2022-06-25 08:38:17 +02:00
chrchr-github 16a4449901
Fix crash with statement expression (#4142) 2022-05-28 00:11:23 +02:00
Rikard Falkeborn 068e5bad27
Fix #9966: FP memleak with multiple assignments in if-statement (#4138)
Similar to how we do for assignments outside if-statements, bail out
since we do not track multiple variables.
2022-05-27 07:57:43 +02:00
chrchr-github e9a0d7979e
Fix #11014 FN redundantPointerOp / remove simplifyMulAndParens() (#4062) 2022-05-01 15:46:07 +02:00