aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp')
-rw-r--r--lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp b/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp
index b41b3c83c6..f25be94b3c 100644
--- a/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp
+++ b/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp
@@ -1358,10 +1358,10 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
}
case Instruction::Alloca:
+ if (!cast<AllocaInst>(&I)->getAllocatedType()->isIntegerTy(8))
+ report_fatal_error("Type of alloca instruction is not i8");
Code = naclbitc::FUNC_CODE_INST_ALLOCA;
- Vals.push_back(VE.getTypeID(I.getType()));
- Vals.push_back(VE.getTypeID(I.getOperand(0)->getType()));
- Vals.push_back(VE.getValueID(I.getOperand(0))); // size.
+ PushValueAndType(I.getOperand(0), InstID, Vals, VE, Stream); // size.
Vals.push_back(Log2_32(cast<AllocaInst>(I).getAlignment())+1);
break;