]> granicus.if.org Git - clang/commitdiff
Fix '<rdar://problem/8202272> __imag passed non-complex should not crash' by removing...
authorTed Kremenek <kremenek@apple.com>
Sat, 17 Jul 2010 01:28:55 +0000 (01:28 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 17 Jul 2010 01:28:55 +0000 (01:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108602 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/GRExprEngine.cpp
test/Analysis/misc-ps.m

index 1424820f3b88916b45b7a70277ffd1a6e21049ec..26b5801068f9690ff34fd0e53c132bf4c14e717c 100644 (file)
@@ -2835,8 +2835,7 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, ExplodedNode* Pred,
           continue;
         }
 
-        // For all other types, UnaryOperator::Float returns 0.
-        assert (Ex->getType()->isIntegerType());
+        // For all other types, UnaryOperator::Imag returns 0.
         const GRState* state = GetState(*I);
         SVal X = ValMgr.makeZeroVal(Ex->getType());
         MakeNode(Dst, U, *I, state->BindExpr(U, X));
index 7de1305049be03eac2518cbe486531b7a4bd0f71..c2099b04a95c22cab322bf00d9ced537460350b3 100644 (file)
@@ -1020,3 +1020,9 @@ void pr7475_warn() {
   *someStatic = 0; // expected-warning{{null pointer}}
 }
 
+// <rdar://problem/8202272> - __imag passed non-complex should not crash
+float f0(_Complex float x) {
+  float l0 = __real x;
+  return  __real l0 + __imag l0;
+}
+