Don't crash on bogus source value

llvm-svn: 10132
This commit is contained in:
Chris Lattner 2003-11-21 20:27:35 +00:00
parent a1da49a55c
commit 70c6fff394

View File

@ -1171,6 +1171,9 @@ ConstVal : SIntType EINT64VAL { // integral constants
ConstExpr: CAST '(' ConstVal TO Types ')' {
if (!$3->getType()->isFirstClassType())
ThrowException("cast constant expression from a non-primitive type: '" +
$3->getType()->getDescription() + "'!");
if (!$5->get()->isFirstClassType())
ThrowException("cast constant expression to a non-primitive type: '" +
$5->get()->getDescription() + "'!");