aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGen.cpp
diff options
context:
space:
mode:
authorRyosuke Niwa <rniwa@webkit.org>2024-10-29 23:13:23 -0700
committerGitHub <noreply@github.com>2024-10-29 23:13:23 -0700
commitb47e2316bf083cd2e0e5ac2ef1e9c913f839a51b (patch)
treeec6c20e15694b756a9a76ada8e80d947c9ddcc84 /llvm/lib/CodeGen/CodeGen.cpp
parentdf0d249b6511289f1e8c1389f4fd33d7b4c083fa (diff)
downloadllvm-b47e2316bf083cd2e0e5ac2ef1e9c913f839a51b.zip
llvm-b47e2316bf083cd2e0e5ac2ef1e9c913f839a51b.tar.gz
llvm-b47e2316bf083cd2e0e5ac2ef1e9c913f839a51b.tar.bz2
[alpha.webkit.UncountedLocalVarsChecker] Warn the use of a raw pointer/reference when the guardian variable gets mutated. (#113859)
This checker has a notion of a guardian variable which is a variable and keeps the object pointed to by a raw pointer / reference in an inner scope alive long enough to "guard" it from use-after-free. But such a guardian variable fails to flawed to keep the object alive if it ever gets mutated within the scope of a raw pointer / reference. This PR fixes this bug by introducing a new AST visitor class, GuardianVisitor, which traverses the compound statements of a guarded variable (raw pointer / reference) and looks for any operator=, move constructor, or calls to "swap", "leakRef", or "releaseNonNull" functions.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGen.cpp')
0 files changed, 0 insertions, 0 deletions