about summary refs log tree commit diff
path: root/Src/subst.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Src/subst.c b/Src/subst.c
index cc59c74d4..7081d467d 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -27,6 +27,8 @@
  *
  */
 
+#include <assert.h>
+
 #include "zsh.mdh"
 #include "subst.pro"
 
@@ -2551,9 +2553,11 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
 		 * to avoid the multsub() horror.
 		 */
 		int tmplen;
-		if (v->pm->node.flags & PM_CACHELEN)
+		if (v->pm->node.flags & PM_CACHELEN) {
 		    tmplen = arrcachelen(v->pm);
-		else
+		    if (v->pm->node.flags & PM_CHECKLEN)
+			assert(tmplen == arrlen(v->pm->gsu.a->getfn(v->pm)));
+		} else
 		    tmplen = arrlen(v->pm->gsu.a->getfn(v->pm));
 
 		if (v->start < 0)