set up GetTagId

This commit is contained in:
Eric Correia 2021-06-20 10:54:53 -04:00
parent f08c764cad
commit 342d1f34c2
6 changed files with 136 additions and 5 deletions

View file

@ -580,6 +580,19 @@ impl<'a> BorrowInfState<'a> {
Call(call) => self.collect_call(z, call),
Literal(_) | RuntimeErrorFunction(_) => {}
GetTagId { structure: x, .. } => {
// if the structure (record/tag/array) is owned, the extracted value is
if self.is_owned(*x) {
self.own_var(z);
}
// if the extracted value is owned, the structure must be too
if self.is_owned(z) {
self.own_var(*x);
}
}
}
}