about summary refs log tree commit diff
path: root/tvix/eval/src/compiler/attrs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/compiler/attrs.rs')
-rw-r--r--tvix/eval/src/compiler/attrs.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/tvix/eval/src/compiler/attrs.rs b/tvix/eval/src/compiler/attrs.rs
index bb48ffbb09..c9897daac2 100644
--- a/tvix/eval/src/compiler/attrs.rs
+++ b/tvix/eval/src/compiler/attrs.rs
@@ -113,12 +113,14 @@ impl Compiler<'_, '_> {
     pub(super) fn compile_has_attr(&mut self, slot: LocalIdx, node: ast::HasAttr) {
         // Put the attribute set on the stack.
         self.compile(slot, node.expr().unwrap());
+        self.emit_force(&node);
 
         // Push all path fragments with an operation for fetching the
         // next nested element, for all fragments except the last one.
         for (count, fragment) in node.attrpath().unwrap().attrs().enumerate() {
             if count > 0 {
                 self.push_op(OpCode::OpAttrsTrySelect, &fragment);
+                self.emit_force(&fragment);
             }
 
             self.compile_attr(slot, fragment);