Skip to content

Commit

Permalink
set static call to EVM flag correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
joonazan committed Jun 10, 2024
1 parent 0da56df commit 6102d7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/instruction_handlers/far_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,15 @@ fn far_call<const CALLING_MODE: u8, const IS_STATIC: bool, const IS_SHARD: bool>
.checked_add(stipend)
.expect("stipend must not cause overflow");

let new_frame_is_static = IS_STATIC || vm.state.current_frame.is_static;
vm.push_frame::<CALLING_MODE>(
instruction,
u256_into_address(destination_address),
program,
new_frame_gas,
stipend,
exception_handler,
(IS_STATIC || vm.state.current_frame.is_static) && !is_evm_interpreter,
new_frame_is_static && !is_evm_interpreter,
calldata.memory_page,
vm.world_diff.snapshot(),
);
Expand All @@ -137,7 +138,7 @@ fn far_call<const CALLING_MODE: u8, const IS_STATIC: bool, const IS_SHARD: bool>
vm.state.register_pointer_flags = 2;
vm.state.registers[1] = calldata.into_u256();

let is_static_call_to_evm_interpreter = IS_STATIC && is_evm_interpreter;
let is_static_call_to_evm_interpreter = new_frame_is_static && is_evm_interpreter;
let call_type = (u8::from(is_static_call_to_evm_interpreter) << 2)
| (u8::from(abi.is_system_call) << 1)
| u8::from(abi.is_constructor_call);
Expand Down

0 comments on commit 6102d7b

Please sign in to comment.