If a pointer cast fails (evaluates to an UnknownVal) and such cast is the last use of the pointer, the pointer is no longer referenced by the program state and a leak is (mis-)diagnosed. Produce pointer escape (but not invalidation) when the cast fails to avoid such false positives.
Details
Details
- Reviewers
dcoughlin xazax.hun a.sidorin george.karpenkov szepet - Commits
- rG468bc0d8b9c5: [analyzer] When we fail to evaluate a pointer cast, escape the pointer.
rL330380: [analyzer] When we fail to evaluate a pointer cast, escape the pointer.
rC330380: [analyzer] When we fail to evaluate a pointer cast, escape the pointer.
Diff Detail
Diff Detail
- Repository
- rC Clang
Event Timeline
Comment Actions
I am in favour of this approach. This is what I suggested back than in https://reviews.llvm.org/D23014 but it was somehow overlooked.
Comment Actions
Hmm, yeah, indeed, i must have overlooked it, nice one :) I'll see if i can fix the other place as well.