mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
Fix Slice passed incorrectly in LLVM IR to procedure called via procedure pointer #465
This commit is contained in:
+1
-11
@@ -1350,17 +1350,7 @@ soa_struct_layout :: proc() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main :: proc() {
|
main :: proc() {
|
||||||
id: typeid;
|
when true {
|
||||||
id = typeid_of(int);
|
|
||||||
|
|
||||||
if id == bool {
|
|
||||||
fmt.println("HERE1");
|
|
||||||
}
|
|
||||||
fmt.println("HERE2");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
when false {
|
|
||||||
extra_general_stuff();
|
extra_general_stuff();
|
||||||
union_type();
|
union_type();
|
||||||
parametric_polymorphism();
|
parametric_polymorphism();
|
||||||
|
|||||||
@@ -2407,6 +2407,19 @@ void set_procedure_abi_types(gbAllocator allocator, Type *type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i32 i = 0; i < type->Proc.param_count; i++) {
|
||||||
|
Entity *e = type->Proc.params->Tuple.variables[i];
|
||||||
|
if (e->kind == Entity_Variable) {
|
||||||
|
set_procedure_abi_types(allocator, e->type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (i32 i = 0; i < type->Proc.result_count; i++) {
|
||||||
|
Entity *e = type->Proc.results->Tuple.variables[i];
|
||||||
|
if (e->kind == Entity_Variable) {
|
||||||
|
set_procedure_abi_types(allocator, e->type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE(bill): The types are the same
|
// NOTE(bill): The types are the same
|
||||||
type->Proc.abi_compat_result_type = type_to_abi_compat_result_type(allocator, type->Proc.results, type->Proc.calling_convention);
|
type->Proc.abi_compat_result_type = type_to_abi_compat_result_type(allocator, type->Proc.results, type->Proc.calling_convention);
|
||||||
type->Proc.return_by_pointer = abi_compat_return_by_pointer(allocator, type->Proc.calling_convention, type->Proc.abi_compat_result_type);
|
type->Proc.return_by_pointer = abi_compat_return_by_pointer(allocator, type->Proc.calling_convention, type->Proc.abi_compat_result_type);
|
||||||
|
|||||||
Reference in New Issue
Block a user