]> granicus.if.org Git - clang/commitdiff
'error' is usually used as a noreturn function. This can suppress some false
authorZhongxing Xu <xuzhongxing@gmail.com>
Mon, 26 Oct 2009 05:18:31 +0000 (05:18 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Mon, 26 Oct 2009 05:18:31 +0000 (05:18 +0000)
warnings. Eventually we need a way to import externally defined functions
summaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85092 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/GRExprEngine.cpp

index 08e02feb082bf5979398f7ca1deae8de7211d909..b146c55d893ac30880d971f7840354ced576ac5c 100644 (file)
@@ -1454,17 +1454,10 @@ static void MarkNoReturnFunction(const FunctionDecl *FD, CallExpr *CE,
       break;
 
     case 5:
-      if (!memcmp(s, "panic", 5)) Builder->BuildSinks = true;
-      else if (!memcmp(s, "error", 5)) {
-        if (CE->getNumArgs() > 0) {
-          SVal X = state->getSVal(*CE->arg_begin());
-          // FIXME: use Assume to inspect the possible symbolic value of
-          // X. Also check the specific signature of error().
-          nonloc::ConcreteInt* CI = dyn_cast<nonloc::ConcreteInt>(&X);
-          if (CI && CI->getValue() != 0)
-            Builder->BuildSinks = true;
-        }
-      }
+      if (!memcmp(s, "panic", 5)) 
+        Builder->BuildSinks = true;
+      else if (!memcmp(s, "error", 5))
+        Builder->BuildSinks = true;
       break;
 
     case 6: