Browse Source

Wrong resize condition fixed

[Delivers #80191662]
cl-refactor
Paweł Bylica 10 years ago
parent
commit
0128f09065
  1. 2
      evmcc/Memory.cpp
  2. 1
      evmcc/bytecode/mem2.evm
  3. 11
      evmcc/lll/mem2.lll

2
evmcc/Memory.cpp

@ -75,7 +75,7 @@ llvm::Function* Memory::createFunc(bool _isStore, llvm::Type* _valueType, llvm::
auto valueSize = _valueType->getPrimitiveSizeInBits() / 8;
auto sizeRequired = builder.CreateAdd(index, builder.getIntN(256, valueSize), "sizeRequired");
auto size = builder.CreateLoad(m_size, "size");
auto resizeNeeded = builder.CreateICmpULE(sizeRequired, size, "resizeNeeded");
auto resizeNeeded = builder.CreateICmpULE(size, sizeRequired, "resizeNeeded");
builder.CreateCondBr(resizeNeeded, resizeBB, accessBB); // OPT branch weights?
builder.SetInsertPoint(resizeBB);

1
evmcc/bytecode/mem2.evm

@ -0,0 +1 @@
6001610d80556504409585d6df620493e05462061a8053

11
evmcc/lll/mem2.lll

@ -0,0 +1,11 @@
(asm ;; []
1
3456
MSTORE8 ;; [02]
4675432994527
300000
MSTORE
400000
MLOAD
)
Loading…
Cancel
Save