about summary refs log tree commit diff
path: root/tvix/eval/src
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src')
-rw-r--r--tvix/eval/src/compiler/mod.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs
index faf67135ed62..a7e5ceb32af4 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -859,6 +859,12 @@ impl Compiler {
         self.emit_constant(Value::String(ident.ident_token().unwrap().text().into()));
     }
 
+    /// Patch the jump instruction at the given index, setting its
+    /// jump offset from the placeholder to the current code position.
+    ///
+    /// This is required because the actual target offset of jumps is
+    /// not known at the time when the jump operation itself is
+    /// emitted.
     fn patch_jump(&mut self, idx: CodeIdx) {
         let offset = self.chunk().code.len() - 1 - idx.0;