diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-10-09 03:19:06 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-10-09 03:19:06 +0000 |
commit | cc06b463f56a5fa7fbd07ffc8e99c2139cb460da (patch) | |
tree | 57c0b355515e02e87e014b6fe62d9a850abd71a0 | |
parent | 1207d3195276362a1dd9bfbefccd847bd557454a (diff) | |
download | bcm5719-llvm-cc06b463f56a5fa7fbd07ffc8e99c2139cb460da.tar.gz bcm5719-llvm-cc06b463f56a5fa7fbd07ffc8e99c2139cb460da.zip |
Check some cases for previous patch. Make the code more robust.
llvm-svn: 57317
-rw-r--r-- | clang/lib/Analysis/GRExprEngine.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index a6b501372f3..c391c6f3789 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/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; |