From 546a6b42b3a2b1172fbd099a0fee2864af16461c Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 13 Dec 2015 17:35:12 +0100 Subject: Assert on problems --- Src/builtin.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Src/builtin.c') diff --git a/Src/builtin.c b/Src/builtin.c index 27355feff..534f49b57 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -30,6 +30,8 @@ /* this is defined so we get the prototype for open_memstream */ #define _GNU_SOURCE 1 +#include + #include "zsh.mdh" #include "builtin.pro" @@ -3404,6 +3406,7 @@ bin_unset(char *name, char **argv, Options ops, int func) } else { /* start is after the element for reverse index */ int start = vbuf.start - !!(vbuf.flags & VALFLAG_INV); + assert(vbuf.pm->length == arrlen(vbuf.pm->u.arr)); if (start < vbuf.pm->length) { char *arr[2]; arr[0] = ""; -- cgit 1.4.1