mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix #2305
This commit is contained in:
@@ -3097,6 +3097,9 @@ gb_internal lbValue lb_build_expr_internal(lbProcedure *p, Ast *expr) {
|
|||||||
|
|
||||||
// NOTE(bill): Short on constant values
|
// NOTE(bill): Short on constant values
|
||||||
return lb_const_value(p->module, type, tv.value);
|
return lb_const_value(p->module, type, tv.value);
|
||||||
|
} else if (tv.mode == Addressing_Type) {
|
||||||
|
// NOTE(bill, 2023-01-16): is this correct? I hope so at least
|
||||||
|
return lb_typeid(m, tv.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (expr->kind) {
|
switch (expr->kind) {
|
||||||
|
|||||||
@@ -3125,6 +3125,8 @@ gb_internal lbValue lb_build_call_expr_internal(lbProcedure *p, Ast *expr) {
|
|||||||
GB_ASSERT(e->kind == Entity_Variable);
|
GB_ASSERT(e->kind == Entity_Variable);
|
||||||
if (args[i].value == nullptr) {
|
if (args[i].value == nullptr) {
|
||||||
args[i] = lb_handle_param_value(p, e->type, e->Variable.param_value, ast_token(expr).pos);
|
args[i] = lb_handle_param_value(p, e->type, e->Variable.param_value, ast_token(expr).pos);
|
||||||
|
} else if (is_type_typeid(e->type) && !is_type_typeid(args[i].type)) {
|
||||||
|
args[i] = lb_typeid(p->module, args[i].type);
|
||||||
} else {
|
} else {
|
||||||
args[i] = lb_emit_conv(p, args[i], e->type);
|
args[i] = lb_emit_conv(p, args[i], e->type);
|
||||||
}
|
}
|
||||||
@@ -3274,10 +3276,15 @@ gb_internal lbValue lb_build_call_expr_internal(lbProcedure *p, Ast *expr) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
GB_ASSERT_MSG(args[i].value != nullptr, "%.*s", LIT(e->token.string));
|
GB_ASSERT_MSG(args[i].value != nullptr, "%.*s", LIT(e->token.string));
|
||||||
|
if (is_type_typeid(e->type) && !is_type_typeid(args[i].type)) {
|
||||||
|
GB_ASSERT(LLVMIsNull(args[i].value));
|
||||||
|
args[i] = lb_typeid(p->module, args[i].type);
|
||||||
|
} else {
|
||||||
args[i] = lb_emit_conv(p, args[i], e->type);
|
args[i] = lb_emit_conv(p, args[i], e->type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (variadic && !vari_expand && !is_c_vararg) {
|
if (variadic && !vari_expand && !is_c_vararg) {
|
||||||
// variadic call argument generation
|
// variadic call argument generation
|
||||||
|
|||||||
Reference in New Issue
Block a user