about summary refs log tree commit diff
path: root/tvix/eval/src/opcode.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-09-03T00·06+0300
committertazjin <tazjin@tvl.su>2022-09-08T19·54+0000
commitf8575fcd747eb3fe05413611eb97e26981bc9e1b (patch)
tree928c7fcbe62ee28fd48eaa0c55cd426e30d415e1 /tvix/eval/src/opcode.rs
parente9b6ecb0ee8e7991a93e4b5ae15e74dcf9ffaa0d (diff)
fix(tvix/eval): compare *stack* slots when deciding whether to defer r/4756
When deciding whether an upvalue needs to have a deferred resolution
step, the *stack* indexes should be compared - not the locals indexes.

The results are almost always the same, but there are tricky
situations where this can cause errors.

It's difficult to reproduce these errors in isolation, as they depend
on other scope behaviour, so this is one in a series of commits to
address the combination of issues which will gain some tests at the
end.

Change-Id: Iaa400b8d9500af58f493ab10e4f95022f3b5dd21
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6423
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Diffstat (limited to '')
-rw-r--r--tvix/eval/src/opcode.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/eval/src/opcode.rs b/tvix/eval/src/opcode.rs
index b009686736..871111883b 100644
--- a/tvix/eval/src/opcode.rs
+++ b/tvix/eval/src/opcode.rs
@@ -13,7 +13,7 @@ pub struct CodeIdx(pub usize);
 
 /// Index of a value in the runtime stack.
 #[repr(transparent)]
-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd)]
 pub struct StackIdx(pub usize);
 
 /// Index of an upvalue within a closure's upvalue list.