Skip to content

Commit

Permalink
Add workaround for address on stack
Browse files Browse the repository at this point in the history
  • Loading branch information
einar-polygon committed Sep 2, 2024
1 parent 0f35494 commit a9b13a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions zero_bin/rpc/src/native/txn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,14 @@ pub fn generate_jumpdest_table(
callee_raw_opt.is_some(),
"Stack must contain at least two values for a CALL instruction."
);

// Clear the upper half of the operand.
let callee_raw = *callee_raw_opt.unwrap();
let (callee_raw, _overflow) = callee_raw.overflowing_shl(128);
let (callee_raw, _overflow) = callee_raw.overflowing_shr(128);

let lower_bytes = U160::from(callee_raw);
Address::from(lower_bytes)
let lower_20_bytes = U160::from(callee_raw);
Address::from(lower_20_bytes)
};

if precompiles().contains(&callee_address) {
Expand Down

0 comments on commit a9b13a3

Please sign in to comment.