aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-10-09 03:19:06 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-10-09 03:19:06 +0000
commita90d56ea042cfdc7507b4bdf3ca1e2a34e064848 (patch)
treef7d8d0a58f5c52ebb71053e911d439d6b0739153 /lib/Analysis/GRExprEngine.cpp
parentde933f025e839bde4b119f3437c320c2137bbe1f (diff)
Check some cases for previous patch. Make the code more robust.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57317 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index a6b501372f..c391c6f378 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1132,10 +1132,14 @@ void GRExprEngine::VisitCall(CallExpr* CE, NodeTy* Pred,
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;