2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 03:08:27 +08:00

transforms.artiq_ir_generator: fix optarg codegen (closes #205).

This commit is contained in:
whitequark 2015-12-25 12:40:45 +08:00
parent cd8eccfd46
commit 690b2fd034

View File

@ -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)))