Browse Source

Fix memory index having type i256

cl-refactor
Paweł Bylica 10 years ago
parent
commit
0210ae382c
  1. 3
      libevmjit/RuntimeManager.cpp

3
libevmjit/RuntimeManager.cpp

@ -148,7 +148,8 @@ void RuntimeManager::registerReturnData(llvm::Value* _offset, llvm::Value* _size
{
auto memPtr = getBuilder().CreateStructGEP(getRuntimePtr(), 3);
auto mem = getBuilder().CreateLoad(memPtr, "memory");
auto returnDataPtr = getBuilder().CreateGEP(mem, _offset);
auto idx = m_builder.CreateTrunc(_offset, Type::Size, "idx"); // Never allow memory index be a type bigger than i64 // TODO: Report bug & fix to LLVM
auto returnDataPtr = getBuilder().CreateGEP(mem, idx);
set(RuntimeData::ReturnData, returnDataPtr);
auto size64 = getBuilder().CreateTrunc(_size, Type::Size);

Loading…
Cancel
Save