Skip to content

Commit 57ef9bc

Browse files
onbjergmattsse
authored andcommitted
fix: collect push bytes from test setup in fuzzer (foundry-rs#2929)
* fix: collect push bytes from test setup in fuzzer * Update evm/src/fuzz/strategies/state.rs * chore: rustfmt Co-authored-by: Matthias Seitz <[email protected]>
1 parent a540539 commit 57ef9bc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

evm/src/fuzz/strategies/state.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ pub fn build_initial_state<DB: DatabaseRef>(
9090
// Insert basic account information
9191
state.insert(H256::from(*address).into());
9292

93+
// Insert push bytes
94+
if let Some(code) = &account.info.code {
95+
if state.cache.insert(*address) {
96+
for push_byte in collect_push_bytes(code.bytes().clone()) {
97+
state.insert(push_byte);
98+
}
99+
}
100+
}
101+
93102
if include_storage {
94103
// Insert storage
95104
for (slot, value) in &account.storage {

0 commit comments

Comments
 (0)