File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -90,17 +90,20 @@ inline evmc_status_code check_requirements(
90
90
{
91
91
const auto metrics = instruction_table[op];
92
92
93
- if (metrics.gas_cost == instr::undefined)
93
+ if (INTX_UNLIKELY ( metrics.gas_cost == instr::undefined) )
94
94
return EVMC_UNDEFINED_INSTRUCTION;
95
95
96
- if (( state.gas_left -= metrics.gas_cost ) < 0 )
96
+ if (INTX_UNLIKELY (( state.gas_left -= metrics.gas_cost ) < 0 ) )
97
97
return EVMC_OUT_OF_GAS;
98
98
99
99
const auto stack_size = state.stack .size ();
100
- if (stack_size < metrics.stack_height_required )
100
+ if (INTX_UNLIKELY (stack_size == Stack::limit))
101
+ {
102
+ if (metrics.can_overflow_stack )
103
+ return EVMC_STACK_OVERFLOW;
104
+ }
105
+ else if (INTX_UNLIKELY (stack_size < metrics.stack_height_required ))
101
106
return EVMC_STACK_UNDERFLOW;
102
- if (stack_size == Stack::limit && metrics.can_overflow_stack )
103
- return EVMC_STACK_OVERFLOW;
104
107
105
108
return EVMC_SUCCESS;
106
109
}
You can’t perform that action at this time.
0 commit comments