From 5e0ec3a6ead2ff67f22975a07145307dff1ad929 Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 31 Aug 2015 13:42:36 -0600 Subject: [PATCH] ARTIQIRGenerator: fix keyword/optional argument codegen in calls. --- artiq/compiler/transforms/artiq_ir_generator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/artiq/compiler/transforms/artiq_ir_generator.py b/artiq/compiler/transforms/artiq_ir_generator.py index 84d3b07e8..9f9551e4b 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -1483,19 +1483,19 @@ class ARTIQIRGenerator(algorithm.Visitor): for index, arg_name in enumerate(fn_typ.args): if keyword.arg == arg_name: assert args[index] is None - args[index + offset] = arg + args[index] = arg break elif keyword.arg in fn_typ.optargs: for index, optarg_name in enumerate(fn_typ.optargs): if keyword.arg == optarg_name: assert args[len(fn_typ.args) + index] is None - args[len(fn_typ.args) + index + offset] = \ + args[len(fn_typ.args) + index] = \ self.append(ir.Alloc([arg], ir.TOption(arg.type))) break for index, optarg_name in enumerate(fn_typ.optargs): - if args[len(fn_typ.args) + index + offset] is None: - args[len(fn_typ.args) + index + offset] = \ + if args[len(fn_typ.args) + index] is None: + args[len(fn_typ.args) + index] = \ self.append(ir.Alloc([], ir.TOption(fn_typ.optargs[optarg_name]))) if self_arg is not None: