From e86b1be782c2c2f57e968557d7f91bbcc7b8b27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvard=20Th=C3=B6rnros?= Date: Tue, 16 Feb 2021 21:10:03 +0100 Subject: fix the failing testcase --- src/compiler.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/compiler.rs') 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; } -- cgit v1.2.1