Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Removed arbitrary limitations on array accesses
- X-seq: zsh-workers 27561
- From: Michael Hwang <michael.a.hwang@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Removed arbitrary limitations on array accesses
- Date: Mon, 4 Jan 2010 20:38:17 -0500
- Cc: Michael Hwang <michael.a.hwang@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=ZxgOPbzbOZBV79toXGPq11XMzuVgTGFQkLU17ycWxmk=; b=ua3gqsPWzHfefSKjksZEyJJChVUEjfbx7wNuVAla5PknC0MbQlKbR8xnjJzUue1I2E JQFR0ey636jAg+jkDg4MfgdLUXmUPtjCECpL+/fbRIaB+9eI186JgUi2BC/OZNykhIzF ChFQVciEChZx2aSKP11S3/Kvb1WUn83MUusts=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=LLLIwjoPPyqj7NU4amaZfLGZCIp6ZXxXG6GhYb5QPfi8HFUaXNeTc4g9ADkdl4fyPI muJ6iCTR3dxyXHnzI6QM36KoR8QVtBqdIkF+lWGLlO0hZbuSXjAgjKpRYoeuNuhqpUdL MMrm9jVzicKnPHlcDI9wg8oDR2DcCuMJNOvgY=
- In-reply-to: <y>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <y>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author