diff options
author | Chris Lattner <sabre@nondot.org> | 2003-11-21 20:27:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-11-21 20:27:35 +0000 |
commit | ae711a8b48765c6442bfccdce794a466a557480f (patch) | |
tree | f39d0fe02bde5aa9c933995e36d7ff02d6b4834e /lib/AsmParser/llvmAsmParser.y | |
parent | 31f8499e83dc4dccbb57ea7e76d1fd49b7010d0c (diff) | |
download | external_llvm-ae711a8b48765c6442bfccdce794a466a557480f.zip external_llvm-ae711a8b48765c6442bfccdce794a466a557480f.tar.gz external_llvm-ae711a8b48765c6442bfccdce794a466a557480f.tar.bz2 |
Don't crash on bogus source value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/llvmAsmParser.y')
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index e930bc5..8e44501 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -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() + "'!"); |