mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Fix slicing of pointer to array
This commit is contained in:
+1
-1
@@ -8717,7 +8717,7 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
|
|||||||
case Type_Array:
|
case Type_Array:
|
||||||
valid = true;
|
valid = true;
|
||||||
max_count = t->Array.count;
|
max_count = t->Array.count;
|
||||||
if (o->mode != Addressing_Variable) {
|
if (o->mode != Addressing_Variable && !is_type_pointer(o->type)) {
|
||||||
gbString str = expr_to_string(node);
|
gbString str = expr_to_string(node);
|
||||||
error(node, "Cannot slice array '%s', value is not addressable", str);
|
error(node, "Cannot slice array '%s', value is not addressable", str);
|
||||||
gb_string_free(str);
|
gb_string_free(str);
|
||||||
|
|||||||
Reference in New Issue
Block a user