Skip to content

Commit

Permalink
fix(EVM): Fix DUP1 underflow check (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov authored Dec 2, 2024
1 parent 2b6f698 commit cb868ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions system-contracts/contracts/EvmEmulator.yul
Original file line number Diff line number Diff line change
Expand Up @@ -2396,7 +2396,7 @@ object "EvmEmulator" {
}
case 0x80 { // OP_DUP1
evmGasLeft := chargeGas(evmGasLeft, 3)
sp, stackHead := pushStackItem(sp, stackHead, stackHead)
sp, stackHead := pushStackItem(sp, accessStackHead(sp, stackHead), stackHead)
ip := add(ip, 1)
}
case 0x81 { // OP_DUP2
Expand Down Expand Up @@ -5456,7 +5456,7 @@ object "EvmEmulator" {
}
case 0x80 { // OP_DUP1
evmGasLeft := chargeGas(evmGasLeft, 3)
sp, stackHead := pushStackItem(sp, stackHead, stackHead)
sp, stackHead := pushStackItem(sp, accessStackHead(sp, stackHead), stackHead)
ip := add(ip, 1)
}
case 0x81 { // OP_DUP2
Expand Down
2 changes: 1 addition & 1 deletion system-contracts/evm-emulator/EvmEmulatorLoop.template.yul
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ for { } true { } {
}
case 0x80 { // OP_DUP1
evmGasLeft := chargeGas(evmGasLeft, 3)
sp, stackHead := pushStackItem(sp, stackHead, stackHead)
sp, stackHead := pushStackItem(sp, accessStackHead(sp, stackHead), stackHead)
ip := add(ip, 1)
}
case 0x81 { // OP_DUP2
Expand Down

0 comments on commit cb868ae

Please sign in to comment.