add index

This commit is contained in:
Folkert 2021-06-20 21:33:25 +02:00
parent e1af2eb7d0
commit aba01ad62a
3 changed files with 28 additions and 16 deletions

View file

@ -565,6 +565,11 @@ impl<'a> BorrowInfState<'a> {
EmptyArray => {
self.own_var(z);
}
Call(call) => self.collect_call(z, call),
Literal(_) | RuntimeErrorFunction(_) => {}
AccessAtIndex { structure: x, .. } => {
// if the structure (record/tag/array) is owned, the extracted value is
if self.is_owned(*x) {
@ -577,12 +582,16 @@ impl<'a> BorrowInfState<'a> {
}
}
Call(call) => self.collect_call(z, call),
CoerceToTagId { structure: x, .. } => {
// if the structure (record/tag/array) is owned, the extracted value is
if self.is_owned(*x) {
self.own_var(z);
}
Literal(_) | RuntimeErrorFunction(_) => {}
CoerceToTagId { .. } => {
// do nothing for now; when we extract the fields here, that must change
// if the extracted value is owned, the structure must be too
if self.is_owned(z) {
self.own_var(*x);
}
}
GetTagId { structure: x, .. } => {