|
|
@ -394,7 +394,8 @@ void Compiler::compileBasicBlock(BasicBlock& _basicBlock, bytes const& _bytecode |
|
|
|
|
|
|
|
value = Endianness::toBE(m_builder, value); |
|
|
|
auto bytes = m_builder.CreateBitCast(value, llvm::VectorType::get(Type::Byte, 32), "bytes"); |
|
|
|
auto byte = m_builder.CreateExtractElement(bytes, byteNum, "byte"); |
|
|
|
auto safeByteNum = m_builder.CreateZExt(m_builder.CreateTrunc(byteNum, m_builder.getIntNTy(5)), Type::lowPrecision); // Trim index, large values can crash
|
|
|
|
auto byte = m_builder.CreateExtractElement(bytes, safeByteNum, "byte"); |
|
|
|
value = m_builder.CreateZExt(byte, Type::Word); |
|
|
|
|
|
|
|
auto byteNumValid = m_builder.CreateICmpULT(byteNum, Constant::get(32)); |
|
|
|