mirror of
https://github.com/ziglang/zig.git
synced 2025-12-21 13:43:10 +00:00
fix segfault when var args fn proto shows up in ir printing
This commit is contained in:
parent
3d1a0f2ee9
commit
f1b2735a2e
@ -737,7 +737,11 @@ static void ir_print_fn_proto(IrPrint *irp, IrInstructionFnProto *instruction) {
|
||||
for (size_t i = 0; i < instruction->base.source_node->data.fn_proto.params.length; i += 1) {
|
||||
if (i != 0)
|
||||
fprintf(irp->f, ",");
|
||||
ir_print_other_instruction(irp, instruction->param_types[i]);
|
||||
if (instruction->is_var_args && i == instruction->base.source_node->data.fn_proto.params.length - 1) {
|
||||
fprintf(irp->f, "...");
|
||||
} else {
|
||||
ir_print_other_instruction(irp, instruction->param_types[i]);
|
||||
}
|
||||
}
|
||||
fprintf(irp->f, ")->");
|
||||
ir_print_other_instruction(irp, instruction->return_type);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user