diff options
| author | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-02-01 21:39:28 +0100 |
|---|---|---|
| committer | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-02-01 21:40:01 +0100 |
| commit | 82919eabb21a6df3e57b46912c4513dbd56df827 (patch) | |
| tree | 4ee11f40d2be5c99739ae39a556396bcdc5f291c /src | |
| parent | e86852857bc6f6ca1e1cd81db494071c5d9e3ff1 (diff) | |
| parent | 354be47619650cd85c1de2a546139c092a88c80f (diff) | |
| download | sylt-82919eabb21a6df3e57b46912c4513dbd56df827.tar.gz | |
Merge remote-tracking branch 'origin/main' into vectors
Diffstat (limited to 'src')
| -rw-r--r-- | src/vm.rs | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -129,10 +129,6 @@ impl VM { (b, a) // this matches the order they were on the stack } - fn push(&mut self, value: Value) { - self.stack.push(value) - } - fn _peek_up(&self, amount: usize) -> Option<&Value> { self.stack.get(self.stack.len() - amount) } @@ -265,8 +261,7 @@ impl VM { } Op::Set(field) => { - let value = self.pop(); - let inst = self.pop(); + let (inst, value) = self.poppop(); if let Value::BlobInstance(ty, values) = inst { let slot = self.blobs[ty].name_to_field.get(&field).unwrap().0; values.borrow_mut()[slot] = value; |
