Skip to content

Commit

Permalink
Fix edge case for stack parameter that were not properly marked as re…
Browse files Browse the repository at this point in the history
…ad during FnSig analysis
  • Loading branch information
Enkelmann committed Dec 11, 2023
1 parent 73e87dc commit 490a95f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ impl<'a> forward_interprocedural_fixpoint::Context<'a> for Context<'a> {
let value = new_state
.substitute_global_mem_address(value, &self.project.runtime_memory_image);
new_state.track_contained_ids(&value);
new_state.set_read_flag_for_contained_ids(&value);
new_state.set_register(var, value);
}
Def::Store { address, value } => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,15 @@ impl State {
}
}

/// Set the read flag for every tracked ID contained in the given value.
pub fn set_read_flag_for_contained_ids(&mut self, value: &DataDomain<BitvectorDomain>) {
for id in value.referenced_ids() {
if let Some(object) = self.tracked_ids.get_mut(id) {
object.set_read_flag();
}
}
}

/// Set the read and dereferenced flag for every tracked ID contained in the given value.
pub fn set_deref_flag_for_contained_ids(&mut self, value: &DataDomain<BitvectorDomain>) {
for id in value.referenced_ids() {
Expand Down

0 comments on commit 490a95f

Please sign in to comment.