diff --git a/fuzzers/FRET/src/systemstate/stg.rs b/fuzzers/FRET/src/systemstate/stg.rs index 74429db714..56a35704f2 100644 --- a/fuzzers/FRET/src/systemstate/stg.rs +++ b/fuzzers/FRET/src/systemstate/stg.rs @@ -361,7 +361,7 @@ where //============================= Graph Feedback -pub const STG_MAP_SIZE: usize = 1<<20; +pub const STG_MAP_SIZE: usize = 1<<28; // 512MB pub static mut STG_MAP: [u16; STG_MAP_SIZE] = [0; STG_MAP_SIZE]; pub static mut MAX_STG_NUM: usize = 0; pub unsafe fn stg_map_mut_slice<'a>() -> OwnedMutSlice<'a, u16> { @@ -433,7 +433,11 @@ fn set_observer_map(trace : &Vec) { if MAX_STG_NUM < i.index() { MAX_STG_NUM = i.index(); } - STG_MAP[i.index()] = STG_MAP[i.index()].saturating_add(1); + if i.index() < STG_MAP.len() { + STG_MAP[i.index()] = STG_MAP[i.index()].saturating_add(1); + } else { + eprintln!("STG Map index out of bounds: {}", i.index()); + } } } }