Fix '<rdar://problem/8202272> __imag passed non-complex should not crash' by removing a bogus assertion.

llvm-svn: 108602
This commit is contained in:
Ted Kremenek 2010-07-17 01:28:55 +00:00
parent adc81f8ee8
commit b32964d02d
2 changed files with 7 additions and 2 deletions

View 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));

View 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;
}