Unverified Commit 60c23327 by Enkelmann Committed by GitHub

Ensure that generic output IDs are pointer sized in FnSig analysis (#334)

parent cbe2f035
...@@ -85,7 +85,7 @@ impl State { ...@@ -85,7 +85,7 @@ impl State {
self.register.retain(|var, _| callee_saved.contains(var)); 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. /// or to an output ID specific to the call and output register.
fn generate_return_values_for_call( fn generate_return_values_for_call(
&mut self, &mut self,
...@@ -93,12 +93,13 @@ impl State { ...@@ -93,12 +93,13 @@ impl State {
return_args: &[Arg], return_args: &[Arg],
call_tid: &Tid, 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. // or to an output ID specific to the call and output register.
let generic_pointer_size = self.stack_id.unwrap_register().size; let generic_pointer_size = self.stack_id.unwrap_register().size;
let generic_output_relative_values: BTreeMap<AbstractIdentifier, BitvectorDomain> = let generic_output_relative_values: BTreeMap<AbstractIdentifier, BitvectorDomain> =
input_ids input_ids
.iter() .iter()
.filter(|id| id.bytesize() == generic_pointer_size)
.map(|id| (id.clone(), BitvectorDomain::new_top(generic_pointer_size))) .map(|id| (id.clone(), BitvectorDomain::new_top(generic_pointer_size)))
.collect(); .collect();
let mut generic_output = DataDomain::new_top(generic_pointer_size); let mut generic_output = DataDomain::new_top(generic_pointer_size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment