From fe6115bcbbeb3caca596b904231851e24c18afb1 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 dcfc8998f..1ce7c4005 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -885,8 +885,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),