Skip to content

Commit

Permalink
Fix: explicit EVM call stack (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
birchmd authored and vimpunk committed May 18, 2023
1 parent 4607136 commit 18d0796
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions runtime/src/eval/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,7 @@ pub fn create<H: Handler>(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),
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/executor/stack/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
return_data: Vec<u8>,
) -> (ExitReason, Option<H160>, Vec<u8>) {
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(())
Expand Down

0 comments on commit 18d0796

Please sign in to comment.