mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-05-01 04:07:56 +00:00
handle debug info (#16)
This commit is contained in:
+4
-1
@@ -1,3 +1,4 @@
|
||||
use parity_wasm::elements::Module;
|
||||
use std::{
|
||||
fs,
|
||||
io::{self, Read, Write},
|
||||
@@ -101,8 +102,10 @@ mod gas {
|
||||
run_diff_test("gas", concat!(stringify!($name), ".wat"), |input| {
|
||||
let rules = instrument::gas_metering::ConstantCostRules::default();
|
||||
|
||||
let module =
|
||||
let module: Module =
|
||||
elements::deserialize_buffer(input).expect("Failed to deserialize");
|
||||
let module = module.parse_names().expect("Failed to parse names");
|
||||
|
||||
let instrumented = instrument::gas_metering::inject(module, &rules, "env")
|
||||
.expect("Failed to instrument with gas metering");
|
||||
elements::serialize(instrumented).expect("Failed to serialize")
|
||||
|
||||
Reference in New Issue
Block a user