about summary refs log tree commit diff
path: root/tvix/eval/src/compiler
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-27T16·37+0300
committertazjin <tazjin@tvl.su>2022-09-04T17·53+0000
commit83aa5917b411234b80a13fe5771e3d27eb95c985 (patch)
treeb16f3e4d36dff95ca134ca894992403d041e8396 /tvix/eval/src/compiler
parent4bf096ee6e4318c3ed9049bb2226fc89a6bf4059 (diff)
fix(tvix/eval): declare locals before marking them initialised r/4641
This has no effect yet, other than changing the way in which some
upvalue captures break (that are already not working correctly).

However, after this change the compiler correctly detects
self-recursion and can start emitting the instructions to deal with
this at runtime.

Change-Id: Id3b0ac206c0204739597a4325bcc66f9c806c242
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6309
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval/src/compiler')
-rw-r--r--tvix/eval/src/compiler/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs
index 8defea9a4988..63ffe61bcd98 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -833,9 +833,9 @@ impl Compiler {
                 todo!("nested bindings in let expressions :(")
             }
 
-            self.compile(entry.value().unwrap());
             let name = path.pop().unwrap();
             self.declare_local(entry.attrpath().unwrap().syntax().clone(), &name);
+            self.compile(entry.value().unwrap());
             self.mark_initialised(&name);
         }