[all-commits] [llvm/llvm-project] 7ba3c5: [analyzer] Remove some false negatives in StackAdd...
Michael Flanders via All-commits
all-commits at lists.llvm.org
Mon Feb 10 14:20:31 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7ba3c55d91dcd7da5a5eb1c58225f648fb38b740
https://github.com/llvm/llvm-project/commit/7ba3c55d91dcd7da5a5eb1c58225f648fb38b740
Author: Michael Flanders <flanders.michaelk at gmail.com>
Date: 2025-02-10 (Mon, 10 Feb 2025)
Changed paths:
M clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
M clang/test/Analysis/copy-elision.cpp
M clang/test/Analysis/stack-addr-ps.cpp
M clang/test/Analysis/stackaddrleak.c
M clang/test/Analysis/stackaddrleak.cpp
Log Message:
-----------
[analyzer] Remove some false negatives in StackAddrEscapeChecker (#125638)
Fixes https://github.com/llvm/llvm-project/issues/123459.
Previously, when the StackAddrEscapeChecker checked return values, it
did not scan into the structure of the return SVal. Now it does, and we
can catch some more false negatives that were already mocked out in the
tests in addition to those mentioned in
https://github.com/llvm/llvm-project/issues/123459.
The warning message at the moment for these newly caught leaks is not
great. I think they would be better if they had a better trace of why
and how the region leaks. If y'all are happy with these changes, I would
try to improve these warnings and work on normalizing this SVal checking
on the `checkEndFunction` side of the checker also.
Two of the stack address leak test cases now have two warnings, one
warning from return expression checking and another from`
checkEndFunction` `iterBindings` checking. For these two cases, I prefer
the warnings from the return expression checking, but I couldn't figure
out a way to drop the `checkEndFunction` without breaking other
`checkEndFunction` warnings that we do want. Thoughts here?
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list