Patch to remove another recursive visitiation in ExprEngine that is no longer needed because the CFG is fully linearized, this time for the AsmStmt.

-- Erik.
>From 23a4b0578d2f55265606a5e6cfe2a2c091f54bf3 Mon Sep 17 00:00:00 2001
From: Erik Verbruggen <[email protected]>
Date: Tue, 28 Feb 2012 10:19:45 +0100
Subject: [PATCH] Remove a recursive visitiation in ExprEngine that is no
 longer needed because the CFG is fully linearized.

---
 lib/StaticAnalyzer/Core/ExprEngine.cpp |   13 ++-----------
 test/Analysis/nullptr.cpp              |    9 +++++++++
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp 
b/lib/StaticAnalyzer/Core/ExprEngine.cpp
index ffc0916..a8bff38 100644
--- a/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -1655,12 +1655,9 @@ void ExprEngine::VisitAsmStmtHelperOutputs(const AsmStmt 
*A,
     return;
   }
 
-  ExplodedNodeSet Tmp;
-  Visit(*I, Pred, Tmp);
   ++I;
 
-  for (ExplodedNodeSet::iterator NI = Tmp.begin(), NE = Tmp.end();NI != 
NE;++NI)
-    VisitAsmStmtHelperOutputs(A, I, E, *NI, Dst);
+  VisitAsmStmtHelperOutputs(A, I, E, Pred, Dst);
 }
 
 void ExprEngine::VisitAsmStmtHelperInputs(const AsmStmt *A,
@@ -1693,13 +1690,7 @@ void ExprEngine::VisitAsmStmtHelperInputs(const AsmStmt 
*A,
     return;
   }
 
-  ExplodedNodeSet Tmp;
-  Visit(*I, Pred, Tmp);
-
-  ++I;
-
-  for (ExplodedNodeSet::iterator NI = Tmp.begin(), NE = Tmp.end(); NI!=NE; 
++NI)
-    VisitAsmStmtHelperInputs(A, I, E, *NI, Dst);
+  VisitAsmStmtHelperInputs(A, I, E, Pred, Dst);
 }
 
 
diff --git a/test/Analysis/nullptr.cpp b/test/Analysis/nullptr.cpp
index 89b4173..3f2bac1 100644
--- a/test/Analysis/nullptr.cpp
+++ b/test/Analysis/nullptr.cpp
@@ -50,3 +50,12 @@ void zoo1() {
   char **p = 0;
   delete *(p + 0); // expected-warning{{Dereference of null pointer}}
 }
+
+void zoo2() {
+  int **a = 0;
+  int **b = 0;
+  asm ("nop"
+      :"=a"(*a)
+      :"0"(*b) // expected-warning{{Dereference of null pointer}}
+      );
+}
-- 
1.7.5.4

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to