Browse Source

Prealloc memory and count gas for SHA3 and CREATE instructions

[#79942174]
cl-refactor
Paweł Bylica 10 years ago
parent
commit
8267b453c7
  1. 2
      evmcc/Compiler.cpp

2
evmcc/Compiler.cpp

@ -435,6 +435,7 @@ std::unique_ptr<llvm::Module> Compiler::compile(const dev::bytes& bytecode)
{
auto inOff = stack.pop();
auto inSize = stack.pop();
memory.require(inOff, inSize);
auto hash = ext.sha3(inOff, inSize);
stack.push(hash);
}
@ -768,6 +769,7 @@ std::unique_ptr<llvm::Module> Compiler::compile(const dev::bytes& bytecode)
auto endowment = stack.pop();
auto initOff = stack.pop();
auto initSize = stack.pop();
memory.require(initOff, initSize);
auto address = ext.create(endowment, initOff, initSize);
stack.push(address);

Loading…
Cancel
Save