From 690b2fd0343e451682ab93bec3ca0ef68ba5b22c Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 25 Dec 2015 12:40:45 +0800 Subject: [PATCH] transforms.artiq_ir_generator: fix optarg codegen (closes #205). --- artiq/compiler/transforms/artiq_ir_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artiq/compiler/transforms/artiq_ir_generator.py b/artiq/compiler/transforms/artiq_ir_generator.py index c36ce426a..de15e20f4 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -1626,7 +1626,7 @@ class ARTIQIRGenerator(algorithm.Visitor): for index, arg_node in enumerate(node.args): arg = self.visit(arg_node) - if index < len(fn_typ.args): + if index + offset < len(fn_typ.args): args[index + offset] = arg else: args[index + offset] = self.append(ir.Alloc([arg], ir.TOption(arg.type)))