diff options
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 3f6741ec6..40bef0805 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -1630,7 +1630,7 @@ irValue *ir_emit_call(irProcedure *p, irValue *value, irValue **args, isize arg_ if (pt->Proc.c_vararg) { GB_ASSERT(param_count-1 <= arg_count); } else { - GB_ASSERT(param_count == arg_count); + GB_ASSERT_MSG(param_count == arg_count, "%td == %td", param_count, arg_count); } for (isize i = 0; i < param_count; i++) { Entity *e = pt->Proc.params->Tuple.variables[i]; @@ -3954,11 +3954,12 @@ irValue *ir_emit_min(irProcedure *proc, Type *t, irValue *x, irValue *y) { if (is_type_float(t)) { gbAllocator a = proc->module->allocator; i64 sz = 8*type_size_of(a, t); - irValue **args = gb_alloc_array(a, irValue *, 1); + irValue **args = gb_alloc_array(a, irValue *, 2); args[0] = x; + args[1] = y; switch (sz) { - case 32: return ir_emit_global_call(proc, "__min_f32", args, 1); - case 64: return ir_emit_global_call(proc, "__min_f64", args, 1); + case 32: return ir_emit_global_call(proc, "__min_f32", args, 2); + case 64: return ir_emit_global_call(proc, "__min_f64", args, 2); } GB_PANIC("Unknown float type"); } @@ -3971,11 +3972,12 @@ irValue *ir_emit_max(irProcedure *proc, Type *t, irValue *x, irValue *y) { if (is_type_float(t)) { gbAllocator a = proc->module->allocator; i64 sz = 8*type_size_of(a, t); - irValue **args = gb_alloc_array(a, irValue *, 1); + irValue **args = gb_alloc_array(a, irValue *, 2); args[0] = x; + args[1] = y; switch (sz) { - case 32: return ir_emit_global_call(proc, "__max_f32", args, 1); - case 64: return ir_emit_global_call(proc, "__max_f64", args, 1); + case 32: return ir_emit_global_call(proc, "__max_f32", args, 2); + case 64: return ir_emit_global_call(proc, "__max_f64", args, 2); } GB_PANIC("Unknown float type"); } |