From 18d079613cd122976d9027d5cf874ea4025859ae Mon Sep 17 00:00:00 2001 From: Michael Birch Date: Thu, 3 Nov 2022 11:35:26 -0500 Subject: [PATCH] Fix: explicit EVM call stack (#16) --- runtime/src/eval/system.rs | 5 +---- src/executor/stack/executor.rs | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/runtime/src/eval/system.rs b/runtime/src/eval/system.rs index 535a522cd..b91b52a58 100644 --- a/runtime/src/eval/system.rs +++ b/runtime/src/eval/system.rs @@ -301,10 +301,7 @@ pub fn create(runtime: &mut Runtime, is_create2: bool, handler: &mut Err(e) => Control::Exit(e), } } - Capture::Trap(interrupt) => { - push_h256!(runtime, H256::default()); - Control::CreateInterrupt(interrupt) - } + Capture::Trap(interrupt) => Control::CreateInterrupt(interrupt), } } diff --git a/src/executor/stack/executor.rs b/src/executor/stack/executor.rs index 6550a81e2..0ab19fea2 100644 --- a/src/executor/stack/executor.rs +++ b/src/executor/stack/executor.rs @@ -914,8 +914,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> return_data: Vec, ) -> (ExitReason, Option, Vec) { fn check_first_byte(config: &Config, code: &[u8]) -> Result<(), ExitError> { - if config.disallow_executable_format && Some(&Opcode::EOFMAGIC.as_u8()) == code.first() - { + if config.disallow_executable_format && Some(&Opcode::EOFMAGIC.as_u8()) == code.get(0) { return Err(ExitError::InvalidCode(Opcode::EOFMAGIC)); } Ok(())