diff options
author | Vincent Ambo <mail@tazj.in> | 2022-10-08T19·06+0300 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2022-10-08T19·10+0000 |
commit | 207f3dd47e90c1ccc80b4775c1b2d13e5bfc6a72 (patch) | |
tree | 8646baab50f01a825a80846340e3e9125bf949ec /tvix/eval/src/compiler | |
parent | b4d978cd6aeeac25897dc86b437fd2e96827626f (diff) |
fix(tvix/eval): end scope after compiling legacy let bindings r/5069
When contrasting the compilation of the desugared version to the "sugared" version, this was the noticeable difference. This fixes b/203. Change-Id: Iae02ffc56e06de1de091b84cdc59d8fe83a17d69 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6898 Reviewed-by: grfn <grfn@gws.fyi> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/compiler')
-rw-r--r-- | tvix/eval/src/compiler/bindings.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tvix/eval/src/compiler/bindings.rs b/tvix/eval/src/compiler/bindings.rs index ca437e90e996..9f7df1fdca19 100644 --- a/tvix/eval/src/compiler/bindings.rs +++ b/tvix/eval/src/compiler/bindings.rs @@ -659,6 +659,11 @@ impl Compiler<'_> { self.emit_warning(node, WarningKind::DeprecatedLegacyLet); self.scope_mut().begin_scope(); self.compile_bindings(slot, BindingsKind::RecAttrs, node); + + // Remove the temporary scope, but do not emit any additional cleanup + // (OpAttrs consumes all of these locals). + self.scope_mut().end_scope(); + self.emit_constant(Value::String(SmolStr::new_inline("body").into()), node); self.push_op(OpCode::OpAttrsSelect, node); } |