aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AsmParser/llvmAsmParser.y
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-21 20:27:35 +0000
committerChris Lattner <sabre@nondot.org>2003-11-21 20:27:35 +0000
commitae711a8b48765c6442bfccdce794a466a557480f (patch)
treef39d0fe02bde5aa9c933995e36d7ff02d6b4834e /lib/AsmParser/llvmAsmParser.y
parent31f8499e83dc4dccbb57ea7e76d1fd49b7010d0c (diff)
downloadexternal_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.y3
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() + "'!");