diff options
| author | gingerBill <bill@gingerbill.org> | 2019-12-27 17:47:55 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-12-27 17:47:55 +0000 |
| commit | 7140c95c55e59a79039b30bfee6a3204ed62a02b (patch) | |
| tree | 03b2af426fa34102b89237c861faf487695988d7 /src/check_expr.cpp | |
| parent | ceef5db547690740f2e2c112af4e972c9b44c9de (diff) | |
Fix slicing of pointer to array
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index a0978d4a6..8bb771af1 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -8717,7 +8717,7 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type case Type_Array: valid = true; 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); error(node, "Cannot slice array '%s', value is not addressable", str); gb_string_free(str); |