From 86a6fe460665c752c4e00a7e0864459615c467f0 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Wed, 7 Oct 2020 18:59:35 +0800 Subject: [PATCH] compiler: fix incorrect with behavior --- artiq/compiler/transforms/artiq_ir_generator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/artiq/compiler/transforms/artiq_ir_generator.py b/artiq/compiler/transforms/artiq_ir_generator.py index a57135ed3..f07094805 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -855,8 +855,7 @@ class ARTIQIRGenerator(algorithm.Visitor): self.current_assign = None none = self.append(ir.Alloc([], builtins.TNone())) - call = self._user_call(exit_fn, [none, none, none], {}) - cleanup.append(lambda: call) + cleanup.append(lambda fn=exit_fn: self._user_call(fn, [none, none, none], {})) self._try_finally( body_gen=lambda: self.visit(node.body),