diff options
-rw-r--r-- | functions.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/functions.c b/functions.c index e3987ff..4b93b44 100644 --- a/functions.c +++ b/functions.c @@ -1325,6 +1325,8 @@ fnPick(Array *left, Array *right) add *= result->shape[k]; index += add; } + if(index >= result->size) + throwerror(nil, EIndex); Array *tmp = result; result = arrayitem(result, index); freearray(tmp); |