From 3fa6b13c1e8cbd7a007365dbac0ffc30d03d8472 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 13 Mar 2023 00:30:27 +0300 Subject: feat(tvix/eval): track span of first force in a thunk blackhole This is step 1 towards being able to use all 4 spans that we know when dealing with infinite recursion. It tracks the span at which the force of a thunk was first requested when constructing a blackhole, so that we can highlight the spans of the first and second forces. These are actually the least relevant spans, but the easiest to put in place, more coming soon. Change-Id: I4c7e82f6211b98756439d4148a4191457cc46807 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8269 Autosubmit: tazjin Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/eval/src/vm/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tvix/eval/src/vm/mod.rs') diff --git a/tvix/eval/src/vm/mod.rs b/tvix/eval/src/vm/mod.rs index 450d950b34..0fb1f9cd8c 100644 --- a/tvix/eval/src/vm/mod.rs +++ b/tvix/eval/src/vm/mod.rs @@ -483,7 +483,10 @@ impl<'o> VM<'o> { let gen_span = frame.current_light_span(); self.push_call_frame(span, frame); - self.enqueue_generator("force", gen_span, |co| thunk.force(co)); + self.enqueue_generator("force", gen_span.clone(), |co| { + thunk.force(co, gen_span) + }); + return Ok(false); } } -- cgit 1.4.1