about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-09-13T13·08+0300
committertazjin <tazjin@tvl.su>2022-09-13T14·41+0000
commit62623ef46ce6cf0a6e76806440b0321a7f3792a7 (patch)
tree54027edb537c2d16d6dc799486ca64851bd547e8 /tvix
parent30de72fefb58a1fc67e3508442af75d46cae4760 (diff)
refactor(tvix/eval): point `OpAssert` span at condition r/4842
This is more useful than pointing it at the entire assert expression,
as that includes the body as well which is not going to be relevant in
the error.

Pointed out by sterni in cl/6391

Change-Id: I95a5d1edf90df65e7fa53d4d04502afd6e99e89a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6566
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix')
-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 bcf4abacd776..b22ab0a50663 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -515,7 +515,7 @@ impl Compiler<'_, '_> {
     fn compile_assert(&mut self, slot: LocalIdx, node: ast::Assert) {
         // Compile the assertion condition to leave its value on the stack.
         self.compile(slot, node.condition().unwrap());
-        self.push_op(OpCode::OpAssert, &node);
+        self.push_op(OpCode::OpAssert, &node.condition().unwrap());
 
         // The runtime will abort evaluation at this point if the
         // assertion failed, if not the body simply continues on like