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 df6f469..b40fe4d 100644
--- a/eval.c
+++ b/eval.c
@@ -584,6 +584,10 @@ static Status eval_val_ptr_at_index(Location where, Value *arr, U64 i, Type *arr
err_print(where, "Slice out of bounds (%lu, slice size = %lu)\n", (unsigned long)i, (unsigned long)slice_sz);
return false;
}
+ if (!arr->slice.data) {
+ err_print(where, "Indexing null slice.");
+ return false;
+ }
*ptr = (char *)arr->slice.data + compiler_sizeof(arr_type->slice) * i;
if (type) *type = arr_type->slice;
} break;