[PATCH] D47135: [analyzer] A checker for dangling internal buffer pointers in C++

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat May 26 11:30:24 PDT 2018


xazax.hun added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:73
+    if (State->contains<RawPtrMap>(TypedR)) {
+      const SymbolRef *StrBufferPtr = State->get<RawPtrMap>(TypedR);
+      const Expr *Origin = Call.getOriginExpr();
----------------
xazax.hun wrote:
> What if no symbol is associated with the region? Won't this return null that we dereference later on?
Oh, never mind this one, I did not notice the `contains` call above.


https://reviews.llvm.org/D47135





More information about the cfe-commits mailing list