about summary refs log tree commit diff
path: root/tvix/eval/src/vm.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-28T14·01+0300
committertazjin <tazjin@tvl.su>2022-09-06T07·45+0000
commit705c1b9d535a2a57d3f7f2208818015adaa255a8 (patch)
treea05ff4b6cfc6c4d468ff0ced5733346552b722a9 /tvix/eval/src/vm.rs
parent776120de05fc9f26d1af5da92d8b25ec26648365 (diff)
fix(tvix/eval): correct runtime error for missing dynamic upvalue r/4660
Change-Id: I75c351619780fdc5186a54f3df9b244ada984069
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6324
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval/src/vm.rs')
-rw-r--r--tvix/eval/src/vm.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index 7b3de6406549..316732dba0ed 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -381,6 +381,12 @@ impl VM {
 
                 OpCode::OpGetUpvalue(upv_idx) => {
                     let value = self.frame().closure.upvalue(upv_idx).clone();
+                    if let Value::DynamicUpvalueMissing(name) = value {
+                        return Err(
+                            ErrorKind::UnknownDynamicVariable(name.as_str().to_string()).into()
+                        );
+                    }
+
                     self.push(value);
                 }