aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/Reader.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-11 23:20:20 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-11 23:20:20 +0000
commita77fa7edbfb999c487c6da89fcfecafb4b9e83be (patch)
tree3f767a61e24ca736172f2574460b92439eecb596 /lib/Bytecode/Reader/Reader.cpp
parent1565491af254368a2b016b5886cd6f5c46d36993 (diff)
Create the cast constant expression that was read instead of attempting
to infer the cast from its operand and type. This fixes: test/Regression/Bytecode/2006-12-11-Cast-ConstExpr.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/Reader.cpp')
-rw-r--r--lib/Bytecode/Reader/Reader.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index 2ac92bc946..e2ab8c10e6 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -1325,7 +1325,8 @@ Value *BytecodeReader::ParseConstantPoolValue(unsigned TypeID) {
if (!Instruction::isCast(Opcode))
error("Only cast instruction has one argument for ConstantExpr");
- Constant *Result = ConstantExpr::getCast(ArgVec[0], getType(TypeID));
+ Constant *Result = ConstantExpr::getCast(Opcode, ArgVec[0],
+ getType(TypeID));
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
return Result;
} else if (Opcode == Instruction::GetElementPtr) { // GetElementPtr