aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler.rs
diff options
context:
space:
mode:
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;
}