Skip to content

Commit

Permalink
fix: EXTCODECOPY stack pattern was off
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierBBB committed Nov 1, 2024
1 parent 3e73fb7 commit 6853bb2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ private void log(MessageFrame frame, StackContext pending) {
}

private void copy(MessageFrame frame, StackContext pending) {
if (currentOpcodeData.stackSettings().addressTrimmingInstruction()) {
if (currentOpcodeData.numberOfArguments() == 4) {
// this is the EXTCODECOPY case
Bytes val0 = getStack(frame, 0);
Bytes val1 = getStack(frame, 1);
Bytes val2 = getStack(frame, 2);
Expand All @@ -253,7 +254,9 @@ private void copy(MessageFrame frame, StackContext pending) {
new IndexedStackOperation(
3, StackItem.pop((short) (height - 2), val2, stackStampWithOffset(3))),
new IndexedStackOperation(4, StackItem.pop(height, val0, stamp)));

} else {
// this is the CALLDATACOPY, CODECOPY and RETURNDATACOPY case
Bytes val1 = getStack(frame, 0);
Bytes val2 = getStack(frame, 2);
Bytes val3 = getStack(frame, 1);
Expand Down

0 comments on commit 6853bb2

Please sign in to comment.