summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 9c55a06..f0b53b9 100644
--- a/eval.c
+++ b/eval.c
@@ -594,6 +594,10 @@ static void eval_deref_set(void *set, Value *to, Type *type) {
}
static Status eval_val_ptr_at_index(Location where, void *arr_ptr, U64 i, Type *arr_type, void **ptr, Type **type) {
+ if (arr_type->kind == TYPE_PTR) {
+ arr_type = arr_type->ptr;
+ arr_ptr = *(void **)arr_ptr;
+ }
switch (arr_type->kind) {
case TYPE_ARR: {
U64 arr_sz = (U64)arr_type->arr->n;