mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-06-20 15:51:02 +00:00
fix with indirect calls for gas injector
This commit is contained in:
Generated
+4
-4
@@ -2,7 +2,7 @@
|
|||||||
name = "wasm-gas"
|
name = "wasm-gas"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"parity-wasm 0.3.0 (git+https://github.com/nikvolf/parity-wasm)",
|
"parity-wasm 0.3.2 (git+https://github.com/nikvolf/parity-wasm)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -12,12 +12,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parity-wasm"
|
name = "parity-wasm"
|
||||||
version = "0.3.0"
|
version = "0.3.2"
|
||||||
source = "git+https://github.com/nikvolf/parity-wasm#afb5b8d523227445d648deaee6ca6c9448d24a73"
|
source = "git+https://github.com/nikvolf/parity-wasm#b11f34f2e5410d0773dcf32699d767d7359e4ca9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
"checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8"
|
"checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8"
|
||||||
"checksum parity-wasm 0.3.0 (git+https://github.com/nikvolf/parity-wasm)" = "<none>"
|
"checksum parity-wasm 0.3.2 (git+https://github.com/nikvolf/parity-wasm)" = "<none>"
|
||||||
|
|||||||
+9
-1
@@ -94,7 +94,15 @@ fn main() {
|
|||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
&mut elements::Section::Element(ref mut elements_section) => {
|
||||||
|
for ref mut segment in elements_section.entries_mut() {
|
||||||
|
// update all indirect call addresses initial values
|
||||||
|
for func_index in segment.members_mut() {
|
||||||
|
if *func_index >= gas_func { *func_index += 1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
_ => { }
|
_ => { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user