Merge pull request #13514 from ethereum/yul-interpreter-create2

Fix create2 memory access in yul interpreter.
This commit is contained in:
Daniel Kirchner 2022-09-14 11:19:11 +02:00 committed by GitHub
commit 1730e43bf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,13 @@
{
pop(create2(0, 0, 32, 32))
// This used to store 64
sstore(0, msize())
}
// ====
// EVMVersion: >=constantinople
// ----
// Trace:
// CREATE2(0, 0, 32, 32)
// Memory dump:
// Storage dump:
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000000000000000000000000000000000020

View File

@ -317,7 +317,7 @@ u256 EVMInstructionInterpreter::eval(
logTrace(_instruction, arg);
return (0xcccccc + arg[1]) & u256("0xffffffffffffffffffffffffffffffffffffffff");
case Instruction::CREATE2:
accessMemory(arg[2], arg[3]);
accessMemory(arg[1], arg[2]);
logTrace(_instruction, arg);
return (0xdddddd + arg[1]) & u256("0xffffffffffffffffffffffffffffffffffffffff");
case Instruction::CALL: