diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-17 05:11:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-17 05:11:44 +0000 |
commit | 888d3bc0cdd727e444773cef92d30f29636ecce8 (patch) | |
tree | f297e566d7d82ab4520a454748945785e89d77e8 /lib | |
parent | 60596382aa6d2f54949684a07f5ab0ab881896d7 (diff) | |
download | llvm-888d3bc0cdd727e444773cef92d30f29636ecce8.tar.gz llvm-888d3bc0cdd727e444773cef92d30f29636ecce8.tar.bz2 llvm-888d3bc0cdd727e444773cef92d30f29636ecce8.tar.xz |
Tighten up handling of checks for shift instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9191 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 75472557fe..b14d6a7ecc 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -1093,8 +1093,8 @@ ConstExpr: CAST '(' ConstVal TO Types ')' { | ShiftOps '(' ConstVal ',' ConstVal ')' { if ($5->getType() != Type::UByteTy) ThrowException("Shift count for shift constant must be unsigned byte!"); - if (!$3->getType()->isIntegral()) - ThrowException("Shift constant expression requires integral operand!"); + if (!$3->getType()->isInteger()) + ThrowException("Shift constant expression requires integer operand!"); $$ = ConstantExpr::getShift($1, $3, $5); }; @@ -1631,6 +1631,8 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { | ShiftOps ResolvedVal ',' ResolvedVal { if ($4->getType() != Type::UByteTy) ThrowException("Shift amount must be ubyte!"); + if (!$2->getType()->isInteger()) + ThrowException("Shift constant expression requires integer operand!"); $$ = new ShiftInst($1, $2, $4); } | CAST ResolvedVal TO Types { |