mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-18 17:08:21 +00:00
Fix untyped ternary string IR conversion
This commit is contained in:
@@ -381,6 +381,8 @@ small_stack_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode,
|
||||
return nil;
|
||||
}
|
||||
|
||||
alignment = clamp(alignment, 1, 8*size_of(Stack_Allocation_Header{}.padding)/2);
|
||||
|
||||
raw_alloc :: proc(s: ^Small_Stack, size, alignment: int) -> rawptr {
|
||||
curr_addr := uintptr(&s.data[0]) + uintptr(s.offset);
|
||||
padding := calc_padding_with_header(curr_addr, uintptr(alignment), size_of(Small_Stack_Allocation_Header));
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user