Skip to content

Commit

Permalink
Ensure that generic output IDs are pointer sized in FnSig analysis (#334
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Enkelmann authored Jun 10, 2022
1 parent cbe2f03 commit 60c2332
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,21 @@ impl State {
self.register.retain(|var, _| callee_saved.contains(var));
}

/// Fill every return register that might be a pointer with a value that may point to any input ID
/// Fill every return register that might be a pointer with a value that may point to any pointer-sized input ID
/// or to an output ID specific to the call and output register.
fn generate_return_values_for_call(
&mut self,
input_ids: &BTreeSet<AbstractIdentifier>,
return_args: &[Arg],
call_tid: &Tid,
) {
// Fill every output register with a value that may point to any input ID
// Fill every output register with a value that may point to any pointer-sized input ID
// or to an output ID specific to the call and output register.
let generic_pointer_size = self.stack_id.unwrap_register().size;
let generic_output_relative_values: BTreeMap<AbstractIdentifier, BitvectorDomain> =
input_ids
.iter()
.filter(|id| id.bytesize() == generic_pointer_size)
.map(|id| (id.clone(), BitvectorDomain::new_top(generic_pointer_size)))
.collect();
let mut generic_output = DataDomain::new_top(generic_pointer_size);
Expand Down

0 comments on commit 60c2332

Please sign in to comment.