diff options
| author | gingerBill <bill@gingerbill.org> | 2019-02-14 11:11:05 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-02-14 11:11:05 +0000 |
| commit | dbd06388538b3ba38ab4e5d03c4bc695854f5ff0 (patch) | |
| tree | 87161ae27a60f789ee1f9308d9dcb32b74c05976 /src/ir.cpp | |
| parent | 53d8216311b07237b3a5a6b821c7c5c9c6fdee5c (diff) | |
Fix untyped ternary string IR conversion
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index aca3c3ce9..bdccaa5a6 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -4644,6 +4644,7 @@ irValue *ir_emit_conv(irProcedure *proc, irValue *value, Type *t) { } + // bool <-> llvm bool if (is_type_boolean(src) && dst == t_llvm_bool) { return ir_emit(proc, ir_instr_conv(proc, irConv_trunc, value, src_type, t)); @@ -4906,7 +4907,13 @@ irValue *ir_emit_conv(irProcedure *proc, irValue *value, Type *t) { return ir_emit_load(proc, result); } - + if (is_type_untyped(src)) { + if (is_type_string(src) && is_type_string(dst)) { + irValue *result = ir_add_local_generated(proc, t, false); + ir_emit_store(proc, result, value); + return ir_emit_load(proc, result); + } + } gb_printf_err("ir_emit_conv: src -> dst\n"); gb_printf_err("Not Identical %s != %s\n", type_to_string(src_type), type_to_string(t)); |