Commit 17dfcf15 authored by ben-chain's avatar ben-chain Committed by GitHub

Fix JUMPI inputs ordering (#21)

* fix jumpi inputs ordering

* fix comment
parent 20329295
...@@ -116,8 +116,8 @@ contract OVM_SafetyChecker is iOVM_SafetyChecker { ...@@ -116,8 +116,8 @@ contract OVM_SafetyChecker is iOVM_SafetyChecker {
if ((firstOps >> 192) == 0x3350600060045af1) { if ((firstOps >> 192) == 0x3350600060045af1) {
_pc += 8; _pc += 8;
// Call EM and abort execution if instructed // Call EM and abort execution if instructed
// CALLER PUSH1 0x00 SWAP1 GAS CALL PC PUSH1 0x1d ADD EQ JUMPI RETURNDATASIZE PUSH1 0x00 DUP1 RETURNDATACOPY PUSH1 0x00 REVERT JUMPDEST PUSH1 0x01 PUSH1 0x00 RETURN JUMPDEST // CALLER PUSH1 0x00 SWAP1 GAS CALL PC PUSH1 0x1d ADD JUMPI RETURNDATASIZE PUSH1 0x01 EQ PC PUSH1 0x0c ADD JUMPI RETURNDATASIZE PUSH1 0x00 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x00 REVERT JUMPDEST PUSH1 0x01 PUSH1 0x00 RETURN JUMPDEST
} else if (firstOps == 0x336000905af158601d0157586012013d600114573d6000803e3d6000fd5b6001 && secondOps == 0x6000f35b) { } else if (firstOps == 0x336000905af158601d01573d60011458600c01573d6000803e3d6000FD5b6001 && secondOps == 0x6000f35b) {
_pc += 36; _pc += 36;
} else { } else {
return false; return false;
......
...@@ -1073,7 +1073,7 @@ ...@@ -1073,7 +1073,7 @@
"out": false "out": false
}, },
"valid EM call": { "valid EM call": {
"in": "0x336000905af158601d0157586012013d600114573d6000803e3d6000fd5b60016000f35b", "in": "0x336000905af158601d01573d60011458600c01573d6000803e3d6000FD5b60016000f35b",
"out": true "out": true
}, },
"valid identity precompile call": { "valid identity precompile call": {
...@@ -1081,15 +1081,15 @@ ...@@ -1081,15 +1081,15 @@
"out": true "out": true
}, },
"valid EM call, then valid identity precompile call": { "valid EM call, then valid identity precompile call": {
"in": "0x336000905af158601d0157586012013d600114573d6000803e3d6000fd5b60016000f35b3350600060045af1", "in": "0x336000905af158601d01573d60011458600c01573d6000803e3d6000FD5b60016000f35b3350600060045af1",
"out": true "out": true
}, },
"valid EM call, then invalid identity precompile call": { "valid EM call, then invalid identity precompile call": {
"in": "0x336000905af158601d0157586012013d600114573d6000803e3d6000fd5b60016000f35b3350600060035af1", "in": "0x336000905af158601d01573d60011458600c01573d6000803e3d6000FD5b60016000f35b3350600060035af1",
"out": false "out": false
}, },
"valid EM call, then invalid opcode (SLOAD)": { "valid EM call, then invalid opcode (SLOAD)": {
"in": "0x336000905af158601d0157586012013d600114573d6000803e3d6000fd5b60016000f35b54", "in": "0x336000905af158601d01573d60011458600c01573d6000803e3d6000FD5b60016000f35b54",
"out": false "out": false
}, },
"valid identity precompile call, then invalid opcode (SLOAD)": { "valid identity precompile call, then invalid opcode (SLOAD)": {
...@@ -1097,7 +1097,7 @@ ...@@ -1097,7 +1097,7 @@
"out": false "out": false
}, },
"invalid EM call (missing final byte)": { "invalid EM call (missing final byte)": {
"in": "0x336000905af158601d0157586012013d600114573d6000803e3d6000fd5b60016000f3", "in": "0x336000905af158601d01573d60011458600c01573d6000803e3d6000FD5b60016000f3",
"out": false "out": false
}, },
"invalid identity precompile call (missing final byte)": { "invalid identity precompile call (missing final byte)": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment