diff options
Diffstat (limited to 'lib')
-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() + "'!"); |