diff options
| author | gingerBill <bill@gingerbill.org> | 2020-08-06 00:09:36 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-08-06 00:09:36 +0100 |
| commit | fa903fb4df3024fe7878c34adff1d96c0ffa3d93 (patch) | |
| tree | e1be136b6c6e3a2ed3c6e7564e5b8131da090ed6 /src | |
| parent | 5164d1d86673f40bbea4fd1f04a0406b9f54e460 (diff) | |
Fix #674
Diffstat (limited to 'src')
| -rw-r--r-- | src/ir.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 1a5b2347c..2b3b3e14f 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -3333,6 +3333,13 @@ irValue *ir_emit_call(irProcedure *p, irValue *value, Array<irValue *> const &ar irValue *xx = ir_emit_struct_ev(p, x, cast(i32)j); array_add(&processed_args, xx); } + } else { + if (type_size_of(new_type) == type_size_of(original_type)) { + irValue *x = ir_emit_transmute(p, args[i], new_type); + array_add(&processed_args, x); + } else { + GB_PANIC("ABI ERROR: %s %s %s\n", type_to_string(original_type), type_to_string(new_type), type_to_string(arg_type)); + } } } else { irValue *x = ir_emit_conv(p, args[i], new_type); @@ -6855,10 +6862,6 @@ u64 ir_generate_source_code_location_hash(TokenPos pos) { } irValue *ir_emit_source_code_location(irProcedure *proc, String procedure, TokenPos pos) { - if (pos.file == "") { - gb_printf_err("here\n"); - } - gbAllocator a = ir_allocator(); irValue *v = ir_alloc_value(irValue_SourceCodeLocation); v->SourceCodeLocation.file = ir_find_or_add_entity_string(proc->module, pos.file); |