forked from M-Labs/artiq
1
0
Fork 0

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
1 changed files with 1 additions and 1 deletions

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