[cfe-commits] r163747 - /cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp

Jordan Rose jordan_rose at apple.com
Wed Sep 12 15:48:08 PDT 2012


Author: jrose
Date: Wed Sep 12 17:48:08 2012
New Revision: 163747

URL: http://llvm.org/viewvc/llvm-project?rev=163747&view=rev
Log:
[analyzer] Fix another use of the address of a temporary, like r163402.

Again, GCC is more aggressive about reusing temporary space than we are,
leading to Release build crashes for this undefined behavior.

PR13710 (though it may not be the only problem there)

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=163747&r1=163746&r2=163747&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp Wed Sep 12 17:48:08 2012
@@ -1280,7 +1280,8 @@
       }
 
       if (const BlockEntrance *BE = dyn_cast<BlockEntrance>(&P)) {
-        if (const CFGStmt *S = BE->getFirstElement().getAs<CFGStmt>()) {
+        CFGElement First = BE->getFirstElement();
+        if (const CFGStmt *S = First.getAs<CFGStmt>()) {
           const Stmt *stmt = S->getStmt();
           if (IsControlFlowExpr(stmt)) {
             // Add the proper context for '&&', '||', and '?'.





More information about the cfe-commits mailing list