NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

Looks good tho!



================
Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:63-64
+      RawPtrMapTy Map = State->get<RawPtrMap>();
+      for (const auto Entry : Map) {
+        if (Entry.second == Sym)
+          Found = true;
----------------
Interesting, so we don't have access to the region with which the symbol is 
associated, so we have to scan the whole map.

Probably we can scan the map only once (eg., in the visitor's consturctor if we 
also supply the program state) and then do a direct lookup by region?

Because it's a premature optimization, i'm in favor of a FIXME.


================
Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:155
+  llvm::raw_svector_ostream OS(Buf);
+  OS << "Dangling buffer was obtained here";
+  PathDiagnosticLocation Pos(S, BRC.getSourceManager(),
----------------
Maybe "pointer to dangling buffer".


https://reviews.llvm.org/D48522



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to