[cfe-commits] r57317 - /cfe/trunk/lib/Analysis/GRExprEngine.cpp

Zhongxing Xu xuzhongxing at gmail.com
Wed Oct 8 20:19:08 PDT 2008


Author: zhongxingxu
Date: Wed Oct  8 22:19:06 2008
New Revision: 57317

URL: http://llvm.org/viewvc/llvm-project?rev=57317&view=rev
Log:
Check some cases for previous patch. Make the code more robust.

Modified:
    cfe/trunk/lib/Analysis/GRExprEngine.cpp

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=57317&r1=57316&r2=57317&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Wed Oct  8 22:19:06 2008
@@ -1132,10 +1132,14 @@
           case 5:
             if (!memcmp(s, "panic", 5)) Builder->BuildSinks = true;
             else if (!memcmp(s, "error", 5)) {
-              Expr* Arg = *CE->arg_begin();
-              if (IntegerLiteral* IL = dyn_cast<IntegerLiteral>(Arg))
-                if (IL->getValue() != 0)
+              if (CE->getNumArgs() > 0) {
+                RVal X = GetRVal(St, *CE->arg_begin());
+                // FIXME: use Assume to inspect the possible symbolic value of
+                // X. Also check the specific signature of error().
+                nonlval::ConcreteInt* CI = dyn_cast<nonlval::ConcreteInt>(&X);
+                if (CI && CI->getValue() != 0)
                   Builder->BuildSinks = true;
+              }
             }
             break;
           





More information about the cfe-commits mailing list