Skip to content

Commit

Permalink
fix: ignore unknown opcodes in source maps
Browse files Browse the repository at this point in the history
  • Loading branch information
fvictorio committed Jan 6, 2025
1 parent 1bf9175 commit fec9fca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/edr_solidity/src/source_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ pub fn decode_instructions(
let source_map = &source_maps[instructions.len()];

let pc = bytes_index;
let opcode = OpCode::new(bytecode[pc]).expect("Invalid opcode");
let opcode = match OpCode::new(bytecode[pc]) {
Some(opcode) => opcode,
None => continue,
};

let push_data = if opcode.is_push() {
let push_data = &bytecode[bytes_index..][..1 + opcode.info().immediate_size() as usize];
Expand Down

0 comments on commit fec9fca

Please sign in to comment.