Skip to content

Commit

Permalink
Fix DUP1 underflow check
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov committed Dec 2, 2024
1 parent 7e242cf commit b3563b3
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 @@ -2378,7 +2378,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 @@ -5426,7 +5426,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 @@ -1153,7 +1153,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 b3563b3

Please sign in to comment.