[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: negative bounds of literal arrays
From: |
Ludovic Courtès |
Subject: |
Re: negative bounds of literal arrays |
Date: |
Tue, 12 Dec 2006 15:10:56 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
Hi,
SZAVAI Gyula <address@hidden> writes:
> guile-1.8-20061126
>
> address@hidden(#t #t)
> ==> address@hidden(#t #t)
>
>
> --- orig/libguile/unif.c 2006-11-29 00:28:41.655614400 +0100
> +++ mod/libguile/unif.c 2006-11-29 00:43:33.678280000 +0100
> @@ -2669,7 +2669,7 @@
> }
>
> if (got_it)
> - *resp = res;
> + *resp = sign*res;
> return c;
> }
>
> @@ -2753,6 +2753,9 @@
> {
> c = scm_getc (port);
> c = read_decimal_integer (port, c, &len);
> + if (len < 0)
> + scm_i_input_error (NULL, port,
> + "array length must be non-negative", SCM_EOL);
> s = scm_list_2 (s, scm_from_ssize_t (lbnd+len-1));
> }
I committed this one to both HEAD and 1.8.
While I was at it, I found a bug in `array-in-bounds?': it wouldn't work
for arrays with rank > 1 and different lower bounds for each dimension.
I committed a fix, too (and test case).
Thanks!
Ludovic.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: negative bounds of literal arrays,
Ludovic Courtès <=