Skip to content

Commit 1730e43

Browse files
authored
Merge pull request #13514 from ethereum/yul-interpreter-create2
Fix create2 memory access in yul interpreter.
2 parents f05cbb9 + 69d9869 commit 1730e43

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
pop(create2(0, 0, 32, 32))
3+
// This used to store 64
4+
sstore(0, msize())
5+
}
6+
// ====
7+
// EVMVersion: >=constantinople
8+
// ----
9+
// Trace:
10+
// CREATE2(0, 0, 32, 32)
11+
// Memory dump:
12+
// Storage dump:
13+
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000000000000000000000000000000000020

test/tools/yulInterpreter/EVMInstructionInterpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ u256 EVMInstructionInterpreter::eval(
317317
logTrace(_instruction, arg);
318318
return (0xcccccc + arg[1]) & u256("0xffffffffffffffffffffffffffffffffffffffff");
319319
case Instruction::CREATE2:
320-
accessMemory(arg[2], arg[3]);
320+
accessMemory(arg[1], arg[2]);
321321
logTrace(_instruction, arg);
322322
return (0xdddddd + arg[1]) & u256("0xffffffffffffffffffffffffffffffffffffffff");
323323
case Instruction::CALL:

0 commit comments

Comments
 (0)