aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler.rs
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-02-16 21:10:03 +0100
committerEdvard Thörnros <edvard.thornros@gmail.com>2021-02-16 21:10:03 +0100
commite86b1be782c2c2f57e968557d7f91bbcc7b8b27f (patch)
tree22e603ce7b369b51dc1e2ceaeb63e64c51ea4bfd /src/compiler.rs
parentecc84fc8259ab0f2f5754718ed70e3a57048a540 (diff)
downloadsylt-e86b1be782c2c2f57e968557d7f91bbcc7b8b27f.tar.gz
fix the failing testcase
Diffstat (limited to 'src/compiler.rs')
-rw-r--r--src/compiler.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler.rs b/src/compiler.rs
index ec78118..361d93a 100644
--- a/src/compiler.rs
+++ b/src/compiler.rs
@@ -917,6 +917,9 @@ impl Compiler {
if let Entry::Occupied(entry) = self.unkowns.entry(String::from(name)) {
let (_, (slot, _)) = entry.remove_entry();
self.constants[slot] = self.constants.pop().unwrap();
+ add_op(self, block, Op::Link(slot));
+ } else {
+ add_op(self, block, Op::Link(self.constants.len() - 1));
}
return;
}