mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Unintended deref of pointers with methods caused regression with hash function.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
- Incorrect subscript resolution #1519.
|
||||
- Segfault with passing a program with `-` using stdin.
|
||||
- Using no module with `-` would reject the program.
|
||||
- Unintended deref of pointers with methods caused regression with hash function.
|
||||
|
||||
### Stdlib changes
|
||||
- Remove unintended print of `char[]` as String
|
||||
|
||||
@@ -2618,16 +2618,18 @@ static inline bool sema_expr_analyse_call(SemaContext *context, Expr *expr, bool
|
||||
case DECL_MACRO:
|
||||
struct_var = func_expr->access_expr.parent;
|
||||
if (decl->func_decl.signature.params[0]->var.kind == VARDECL_PARAM_REF) break;
|
||||
if (decl->func_decl.signature.params[0]->type->type_kind == TYPE_POINTER)
|
||||
if (decl->func_decl.signature.params[0]->type->canonical != struct_var->type->canonical
|
||||
&& decl->func_decl.signature.params[0]->type->type_kind == TYPE_POINTER)
|
||||
{
|
||||
expr_insert_addr(struct_var);
|
||||
}
|
||||
break;
|
||||
case DECL_FUNC:
|
||||
struct_var = func_expr->access_expr.parent;
|
||||
if (decl->func_decl.signature.params[0]->type->type_kind == TYPE_POINTER)
|
||||
if (decl->func_decl.signature.params[0]->type->type_kind == TYPE_POINTER )
|
||||
{
|
||||
if (!decl->func_decl.attr_interface_method)
|
||||
if (decl->func_decl.signature.params[0]->type->canonical != struct_var->type->canonical
|
||||
&& !decl->func_decl.attr_interface_method)
|
||||
{
|
||||
expr_insert_addr(struct_var);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user