zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Removed arbitrary limitations on array accesses
@ 2010-01-05  1:38 Michael Hwang
  2010-01-05  9:48 ` Peter Stephenson
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Hwang @ 2010-01-05  1:38 UTC (permalink / raw)
  To: zsh-workers; +Cc: Michael Hwang

This issue was brought up on IRC. It appears that while there is no limit on
how many array elements can be stored, there is a limit to how many can be
accessed. This patch removes these limits.

Michael Hwang

---
 Src/params.c |   16 ----------------
 Src/zsh.h    |    2 --
 2 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/Src/params.c b/Src/params.c
index 0425e07..d092ccc 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1853,22 +1853,6 @@ fetchvalue(Value v, char **pptr, int bracks, int flags)
     if (!bracks && *s)
 	return NULL;
     *pptr = s;
-    if (v->start > MAX_ARRLEN) {
-	zerr("subscript too %s: %d", "big", v->start + !isset(KSHARRAYS));
-	return NULL;
-    }
-    if (v->start < -MAX_ARRLEN) {
-	zerr("subscript too %s: %d", "small", v->start);
-	return NULL;
-    }
-    if (v->end > MAX_ARRLEN+1) {
-	zerr("subscript too %s: %d", "big", v->end - !!isset(KSHARRAYS));
-	return NULL;
-    }
-    if (v->end < -MAX_ARRLEN) {
-	zerr("subscript too %s: %d", "small", v->end);
-	return NULL;
-    }
     return v;
 }
 
diff --git a/Src/zsh.h b/Src/zsh.h
index 060f8a6..1b407b0 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -626,8 +626,6 @@ enum {
     VALFLAG_SUBST =     0x0004  /* Substitution, so apply padding, case flags */
 };
 
-#define MAX_ARRLEN    262144
-
 /********************************************/
 /* Definitions for word code                 */
 /********************************************/
-- 
1.6.2.5


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-01-06 17:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-05  1:38 [PATCH] Removed arbitrary limitations on array accesses Michael Hwang
2010-01-05  9:48 ` Peter Stephenson
2010-01-05 15:32   ` Bart Schaefer
2010-01-05 15:43     ` Mikael Magnusson
2010-01-05 20:48     ` Geoff Wing
2010-01-06 13:42   ` Duncan Sinclair
2010-01-06 14:02     ` Mikael Magnusson
2010-01-06 17:03       ` Richard Hartmann

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).