escape analysis: make list elements imprecise

escape-analysis
pca006132 2022-04-08 23:46:22 +08:00
parent ea5a8c95dc
commit 830fc0f453
1 changed files with 7 additions and 0 deletions

View File

@ -396,6 +396,13 @@ impl<'a> LifetimeAnalyzer<'a> {
// unify with unknown lifetime
self.unify(LifetimeId(0), field_lifetime);
}
if field == "$elem".into() {
let field_lifetime_id = *self.lifetime_to_id.get(&field_lifetime).unwrap();
let field_lifetime = self.lifetime_stores.get_mut(field_lifetime_id).unwrap();
if field_lifetime.kind == PreciseLocal {
field_lifetime.to_mut().kind = ImpreciseLocal;
}
}
}
}
_ => (),