Skip to content

Commit

Permalink
Log and ignore out-of-bounds locals in PDG
Browse files Browse the repository at this point in the history
The dynamic instrumentation code inserts additional
locals for its own instrumentation code.
  • Loading branch information
ahomescu committed Aug 27, 2024
1 parent 677dbdc commit 3888185
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions c2rust-analyze/src/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,14 @@ fn run(tcx: TyCtxt) {
let dest = dest_pl.local;
let dest = Local::from_u32(dest.index);

if acx.local_tys.get(dest).is_none() {
eprintln!(
"pdg: {}: local {:?} appears as dest, but is out of bounds",
n.function.name, dest
);
info.acx_data.set(acx.into_data());
continue;
}
let ptr = match acx.ptr_of(dest) {
Some(x) => x,
None => {
Expand Down

0 comments on commit 3888185

Please sign in to comment.