fix with indirect calls for gas injector

This commit is contained in:
NikVolf
2017-04-27 12:36:40 +03:00
parent b6bcd86ae1
commit 80687d470c
2 changed files with 13 additions and 5 deletions
+4 -4
View File
@@ -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
View File
@@ -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}
}
}
},
_ => { } _ => { }
} }
} }