Skip to content

Commit

Permalink
fix sourcemap issue (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
shouc authored Aug 28, 2023
1 parent 45431ef commit 7703d11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/evm/middlewares/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,11 @@ impl<I, VS, S> Middleware<VS, I, S> for Coverage
self.sources.insert(address, build_artifact.sources.clone());

let sourcemap = build_artifact.get_sourcemap(
Vec::from(host.code.get(&address).unwrap().clone().bytecode())
if (host.code.contains_key(&address)) {
Vec::from(host.code.get(&address).unwrap().clone().bytecode())
} else {
host.setcode_data.get(&address).unwrap().clone().bytecode.to_vec()
}
);

pcs.iter().for_each(|pc| {
Expand Down

0 comments on commit 7703d11

Please sign in to comment.