Skip to content

Commit

Permalink
Fix address for SLOAD
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jan 25, 2017
1 parent 1eb8e26 commit 61a75eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libevmjit/Ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ llvm::Value* Ext::sload(llvm::Value* _index)
{
auto index = Endianness::toBE(m_builder, _index);
auto addrTy = m_builder.getIntNTy(160);
auto address = m_builder.CreateTrunc(Endianness::toBE(m_builder, getRuntimeManager().getAddress()), addrTy);
auto myAddr = Endianness::toBE(m_builder, m_builder.CreateTrunc(Endianness::toNative(m_builder, getRuntimeManager().getAddress()), addrTy));
auto pAddr = m_builder.CreateBitCast(getArgAlloca(), addrTy->getPointerTo());
m_builder.CreateStore(address, pAddr);
m_builder.CreateStore(myAddr, pAddr);
auto func = getQueryFunc(getModule());
auto pValue = getArgAlloca();
createCABICall(func, {pValue, getRuntimeManager().getEnvPtr(), m_builder.getInt32(EVM_SLOAD), pAddr, index});
Expand Down

0 comments on commit 61a75eb

Please sign in to comment.