From 471a9b3fcc5ad5e73d302c64b6760c86e74275e3 Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Mon, 24 Dec 2018 19:28:53 +0100 Subject: [PATCH] Account start function in gas func patching. --- src/gas.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gas.rs b/src/gas.rs index 14f8365..86ffc96 100644 --- a/src/gas.rs +++ b/src/gas.rs @@ -251,6 +251,9 @@ pub fn inject_gas_counter(module: elements::Module, rules: &rules::Set) } } }, + &mut elements::Section::Start(ref mut start_idx) => { + if *start_idx >= gas_func { *start_idx += 1} + }, _ => { } } }