You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[analyzer] Remove some false negatives in StackAddrEscapeChecker (llvm#125638)
Fixesllvm#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
llvm#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?
returnClassWithoutDestructor(v);// no-elide-warning{{Address of stack memory associated with temporary object of type 'ClassWithoutDestructor' returned to caller}}
159
161
// no-elide-warning@-1 {{Address of stack memory associated with temporary \
160
162
object of type 'ClassWithoutDestructor' is still \
161
163
referred to by the caller variable 'v' upon returning to the caller}}
162
164
}
165
+
// Two warnings on no-elide: arg v holds the address of the temporary, and we
166
+
// are returning an object which holds v which holds the address of the temporary
returnClassWithDestructor(v);// no-elide-warning{{Address of stack memory associated with temporary object of type 'ClassWithDestructor' returned to caller}}
304
311
// no-elide-warning@-1 {{Address of stack memory associated with temporary \
305
312
object of type 'ClassWithDestructor' is still referred \
306
313
to by the caller variable 'v' upon returning to the caller}}
307
314
}
315
+
// Two warnings on no-elide: arg v holds the address of the temporary, and we
316
+
// are returning an object which holds v which holds the address of the temporary
0 commit comments