Skip to content

Commit

Permalink
bugfix: minimizer uses incorrect initial state (#430)
Browse files Browse the repository at this point in the history
* bugfix: minimizer uses incorrect initial state

* remove debug
  • Loading branch information
shouc authored Feb 25, 2024
1 parent 8a90173 commit 1f65c65
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/evm/minimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ impl<E: libafl::executors::HasObservers>
txs.extend(input.transactions.iter().map(|ci| ci.to_input(last_sstate.clone())));
assert!(!txs.is_empty());
let mut minimized = false;
let mut initial_state = txs[0].0.sstate.clone();
while !minimized {
minimized = true;
for try_skip in 0..(txs.len()) {
let mut current_state = txs[0].0.sstate.clone();
let mut is_solution = false;
let mut current_state = initial_state.clone();

for (i, item) in txs.iter().enumerate() {
if i == try_skip {
Expand All @@ -132,7 +133,7 @@ impl<E: libafl::executors::HasObservers>

// skip when there is no post execution but the tx is step
if item.0.is_step() && !current_state.state.has_post_execution() {
continue;
break;
}

let (mut tx, call_leak) = item.clone();
Expand Down

0 comments on commit 1f65c65

Please sign in to comment.