diff options
Diffstat (limited to 'src/vm.rs')
| -rw-r--r-- | src/vm.rs | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -294,7 +294,7 @@ impl VM { match (val, slot) { (Value::Tuple(v), Value::Int(slot)) => { let slot = slot as usize; - if v.len() < slot { + if v.len() <= slot { self.stack.push(Value::Nil); let len = v.len(); error!(self, ErrorKind::IndexOutOfBounds(Value::Tuple(v), len, slot)); @@ -715,6 +715,14 @@ impl VM { }; } + Op::Index => { + // We don't have any information about the slot and the indexable might contain + // mixed types. + self.stack.pop().unwrap(); + self.stack.pop().unwrap(); + self.stack.push(Value::Unknown); + } + Op::Call(num_args) => { let new_base = self.stack.len() - 1 - num_args; match self.stack[new_base].clone() { |
