mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
Prealloc memory and count gas for SHA3 and CREATE instructions
[#79942174]
This commit is contained in:
parent
9d9e1600a3
commit
7d674765a4
1 changed files with 2 additions and 0 deletions
|
|
@ -435,6 +435,7 @@ std::unique_ptr<llvm::Module> Compiler::compile(const dev::bytes& bytecode)
|
||||||
{
|
{
|
||||||
auto inOff = stack.pop();
|
auto inOff = stack.pop();
|
||||||
auto inSize = stack.pop();
|
auto inSize = stack.pop();
|
||||||
|
memory.require(inOff, inSize);
|
||||||
auto hash = ext.sha3(inOff, inSize);
|
auto hash = ext.sha3(inOff, inSize);
|
||||||
stack.push(hash);
|
stack.push(hash);
|
||||||
}
|
}
|
||||||
|
|
@ -768,6 +769,7 @@ std::unique_ptr<llvm::Module> Compiler::compile(const dev::bytes& bytecode)
|
||||||
auto endowment = stack.pop();
|
auto endowment = stack.pop();
|
||||||
auto initOff = stack.pop();
|
auto initOff = stack.pop();
|
||||||
auto initSize = stack.pop();
|
auto initSize = stack.pop();
|
||||||
|
memory.require(initOff, initSize);
|
||||||
|
|
||||||
auto address = ext.create(endowment, initOff, initSize);
|
auto address = ext.create(endowment, initOff, initSize);
|
||||||
stack.push(address);
|
stack.push(address);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue