aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ir.cpp6
-rw-r--r--src/ir_print.cpp2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 90cce3699..62eee2f9f 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -3469,6 +3469,12 @@ irValue *ir_emit_call(irProcedure *p, irValue *value, Array<irValue *> const &ar
}
}
+ if (is_c_vararg) {
+ for (isize i = param_count; i < args.count; i++) {
+ array_add(&processed_args, args[i]);
+ }
+ }
+
if (inlining == ProcInlining_none) {
inlining = p->inlining;
}
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 594cc57c2..d4a63506e 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -2310,7 +2310,7 @@ void ir_print_instr(irFileBuffer *f, irModule *m, irValue *value) {
ir_print_type(f, m, t);
ir_write_byte(f, ' ');
ir_print_value(f, m, arg, t);
- param_index++;
+ arg_index++;
}
} else {
// GB_ASSERT(call->args.count == params->variables.count);