Skip to content

Commit

Permalink
Refactor run_litmus
Browse files Browse the repository at this point in the history
Pass candidate execution as a struct to reduce number of arguments to callback
  • Loading branch information
Alasdair committed Jul 15, 2024
1 parent 72e0045 commit 58bc827
Show file tree
Hide file tree
Showing 5 changed files with 295 additions and 280 deletions.
3 changes: 2 additions & 1 deletion isla-axiomatic/src/axiomatic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,8 @@ pub fn final_state_from_z3_output<'exec, 'ev, 'litmus, 'model, B: BV>(
let model_buf: &str = &z3_output[3..];
let mut event_names: Vec<&'ev str> = exec.smt_events.iter().map(|ev| ev.name.as_ref()).collect();
event_names.push("IW");
let mut model = Model::<B>::parse(&event_names, model_buf).map_err(|mpe| FinalLocValuesError::ReadModelError(format!("{}", mpe)))?;
let mut model = Model::<B>::parse(&event_names, model_buf)
.map_err(|mpe| FinalLocValuesError::ReadModelError(format!("{}", mpe)))?;

let mut calc = |loc: &'litmus LitmusLoc<String>| match loc {
LitmusLoc::Register { reg, thread_id } => exec
Expand Down
9 changes: 6 additions & 3 deletions isla-axiomatic/src/footprint_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ pub fn data_dep<B: BV>(from: usize, to: usize, instrs: &[Option<B>], footprints:
if to_footprint.is_system_register_write {
for reg in &to_footprint.register_reads {
if touched.contains(reg) {
return true
return true;
}
}
}
Expand Down Expand Up @@ -672,8 +672,11 @@ where
evrefs.collect_taints(*v, events, &mut footprint.branch_addr_taints)
}
}
Event::Abstract { name, .. } if arch.shared_state.symtab.to_str(*name) == "zsail_system_register_write" =>
footprint.is_system_register_write = true,
Event::Abstract { name, .. }
if arch.shared_state.symtab.to_str(*name) == "zsail_system_register_write" =>
{
footprint.is_system_register_write = true
}
_ => (),
}
}
Expand Down
Loading

0 comments on commit 58bc827

Please sign in to comment.