[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-34-g0f75cc
From: |
Andy Wingo |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-34-g0f75cc7 |
Date: |
Fri, 29 Jul 2011 07:29:26 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=0f75cc78096578f85cc66bba054044116e2ca413
The branch, stable-2.0 has been updated
via 0f75cc78096578f85cc66bba054044116e2ca413 (commit)
via 89f886122a37a051087fbfbbab5400a29a661b06 (commit)
via 3b08b1c24df6d89645e0d1633dac0c4a7b160e6b (commit)
via 2700aa43f21d927fb208b6779a07c8f63d91c27e (commit)
via 7c888dfa6e67e13dd89c459df3ee28f13ab681ec (commit)
via eff3dd99f757410d6ab8d7e3da0a4120d1111192 (commit)
via 2b14df4bc7c317cb25a0bf7cb0bc35c18bb01898 (commit)
via bd61f2e64f745851ff6f0b477ade14a8c2880565 (commit)
via 74ec8d786fd0abd8e2818b373ef8bc7d36fee8ad (commit)
from f4b7d918eff9770f09893b023fd834f5c0bc33d1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0f75cc78096578f85cc66bba054044116e2ca413
Author: Andy Wingo <address@hidden>
Date: Fri Jul 29 09:17:47 2011 +0200
simplify narrow_stack.
* libguile/stacks.c (narrow_stack): Simplify outer narrowing by a number
of frames. Thanks to
http://article.gmane.org/gmane.lisp.guile.devel/12685.
commit 89f886122a37a051087fbfbbab5400a29a661b06
Author: Andy Wingo <address@hidden>
Date: Fri Jul 29 09:14:04 2011 +0200
style fix in read.c
* libguile/read.c (scm_read_sexp): No need to assign to tmp here.
commit 3b08b1c24df6d89645e0d1633dac0c4a7b160e6b
Author: Andy Wingo <address@hidden>
Date: Fri Jul 29 09:11:24 2011 +0200
minor style fix in bytevectors.c
* libguile/bytevectors.c (SCM_BYTEVECTOR_HEADER_BYTES): Use sizeof
scm_t_bits, not sizeof SCM. It's the same, but it seems like the
right thing.
commit 2700aa43f21d927fb208b6779a07c8f63d91c27e
Author: Andy Wingo <address@hidden>
Date: Thu Jul 28 19:12:07 2011 +0200
fix a leak on startup from script.c
* libguile/script.c (scm_get_meta_args): Free nargv. Thanks to
http://article.gmane.org/gmane.lisp.guile.devel/12685. We leak narg
though.
commit 7c888dfa6e67e13dd89c459df3ee28f13ab681ec
Author: Andy Wingo <address@hidden>
Date: Thu Jul 28 19:07:53 2011 +0200
fix read beyond end of hashtable size array in hashtab.c
* libguile/hashtab.c (make_hash_table): Fix read beyond end of
hashtable_size array. Thanks to
http://article.gmane.org/gmane.lisp.guile.devel/12685.
commit eff3dd99f757410d6ab8d7e3da0a4120d1111192
Author: Andy Wingo <address@hidden>
Date: Thu Jul 28 19:04:38 2011 +0200
fix write beyond array end in arrays.c
* libguile/arrays.c (scm_i_read_array): Fix write past end of array
while reading array type tag. Fix non-ascii type tag elements.
Thanks to http://article.gmane.org/gmane.lisp.guile.devel/12685.
commit 2b14df4bc7c317cb25a0bf7cb0bc35c18bb01898
Author: Andy Wingo <address@hidden>
Date: Thu Jul 28 18:17:45 2011 +0200
fix list validation bug in @abort
* libguile/control.c (scm_at_abort): Fix to ensure that we store the
return of scm_ilength in a signed integer, even if later we copy it to
an unsigned. See
http://article.gmane.org/gmane.lisp.guile.devel/12685.
commit bd61f2e64f745851ff6f0b477ade14a8c2880565
Author: Andy Wingo <address@hidden>
Date: Thu Jul 28 17:59:56 2011 +0200
remove dead code in scm_ceiling_quotient
* libguile/numbers.c (scm_ceiling_quotient): Remove dead code. See
http://article.gmane.org/gmane.lisp.guile.devel/12685.
commit 74ec8d786fd0abd8e2818b373ef8bc7d36fee8ad
Author: Andy Wingo <address@hidden>
Date: Thu Jul 28 17:47:31 2011 +0200
fix scm_i_tag_name
* libguile/gc.c (scm_i_tag_name): Fix to work as intended, though it was
not called. See http://article.gmane.org/gmane.lisp.guile.devel/12685.
-----------------------------------------------------------------------
Summary of changes:
libguile/arrays.c | 34 +++++++++++++++++-----------------
libguile/bytevectors.c | 2 +-
libguile/control.c | 3 ++-
libguile/gc.c | 13 +++++--------
libguile/hashtab.c | 2 +-
libguile/numbers.c | 2 --
libguile/read.c | 2 +-
libguile/script.c | 2 ++
libguile/stacks.c | 9 ++++-----
9 files changed, 33 insertions(+), 36 deletions(-)
diff --git a/libguile/arrays.c b/libguile/arrays.c
index 6724d00..d99081c 100644
--- a/libguile/arrays.c
+++ b/libguile/arrays.c
@@ -822,15 +822,6 @@ scm_i_print_array (SCM array, SCM port, scm_print_state
*pstate)
C is the first character read after the '#'.
*/
-static SCM
-tag_to_type (const char *tag, SCM port)
-{
- if (*tag == '\0')
- return SCM_BOOL_T;
- else
- return scm_from_locale_symbol (tag);
-}
-
static int
read_decimal_integer (SCM port, int c, ssize_t *resp)
{
@@ -860,10 +851,10 @@ SCM
scm_i_read_array (SCM port, int c)
{
ssize_t rank;
- char tag[80];
+ scm_t_wchar tag_buf[8];
int tag_len;
- SCM shape = SCM_BOOL_F, elements;
+ SCM tag, shape = SCM_BOOL_F, elements;
/* XXX - shortcut for ordinary vectors. Shouldn't be necessary but
the array code can not deal with zero-length dimensions yet, and
@@ -887,7 +878,7 @@ scm_i_read_array (SCM port, int c)
return SCM_BOOL_F;
}
rank = 1;
- tag[0] = 'f';
+ tag_buf[0] = 'f';
tag_len = 1;
goto continue_reading_tag;
}
@@ -904,13 +895,22 @@ scm_i_read_array (SCM port, int c)
*/
tag_len = 0;
continue_reading_tag:
- while (c != EOF && c != '(' && c != '@' && c != ':' && tag_len < 80)
+ while (c != EOF && c != '(' && c != '@' && c != ':'
+ && tag_len < sizeof tag_buf / sizeof tag_buf[0])
{
- tag[tag_len++] = c;
+ tag_buf[tag_len++] = c;
c = scm_getc (port);
}
- tag[tag_len] = '\0';
-
+ if (tag_len == 0)
+ tag = SCM_BOOL_T;
+ else
+ {
+ tag = scm_string_to_symbol (scm_from_utf32_stringn (tag_buf, tag_len));
+ if (tag_len == sizeof tag_buf / sizeof tag_buf[0])
+ scm_i_input_error (NULL, port, "invalid array tag, starting with: ~a",
+ scm_list_1 (tag));
+ }
+
/* Read shape.
*/
if (c == '@' || c == ':')
@@ -983,7 +983,7 @@ scm_i_read_array (SCM port, int c)
/* Construct array.
*/
- return scm_list_to_typed_array (tag_to_type (tag, port), shape, elements);
+ return scm_list_to_typed_array (tag, shape, elements);
}
diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c
index 7ac1fa3..14159d2 100644
--- a/libguile/bytevectors.c
+++ b/libguile/bytevectors.c
@@ -178,7 +178,7 @@
/* Bytevector type. */
#define SCM_BYTEVECTOR_HEADER_BYTES \
- (SCM_BYTEVECTOR_HEADER_SIZE * sizeof (SCM))
+ (SCM_BYTEVECTOR_HEADER_SIZE * sizeof (scm_t_bits))
#define SCM_BYTEVECTOR_SET_LENGTH(_bv, _len) \
SCM_SET_CELL_WORD_1 ((_bv), (scm_t_bits) (_len))
diff --git a/libguile/control.c b/libguile/control.c
index 9121d17..661de8f 100644
--- a/libguile/control.c
+++ b/libguile/control.c
@@ -248,7 +248,8 @@ SCM_DEFINE (scm_at_abort, "@abort", 2, 0, 0, (SCM tag, SCM
args),
#define FUNC_NAME s_scm_at_abort
{
SCM *argv;
- size_t i, n;
+ size_t i;
+ long n;
SCM_VALIDATE_LIST_COPYLEN (SCM_ARG2, args, n);
argv = alloca (sizeof (SCM)*n);
diff --git a/libguile/gc.c b/libguile/gc.c
index 3ae978f..c68f295 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -739,13 +739,7 @@ accumulate_gc_timer (void * hook_data SCM_UNUSED,
char const *
scm_i_tag_name (scm_t_bits tag)
{
- if (tag >= 255)
- {
- int k = 0xff & (tag >> 8);
- return (scm_smobs[k].name);
- }
-
- switch (tag) /* 7 bits */
+ switch (tag & 0x7f) /* 7 bits */
{
case scm_tcs_struct:
return "struct";
@@ -806,7 +800,10 @@ scm_i_tag_name (scm_t_bits tag)
return "port";
break;
case scm_tc7_smob:
- return "smob"; /* should not occur. */
+ {
+ int k = 0xff & (tag >> 8);
+ return (scm_smobs[k].name);
+ }
break;
}
diff --git a/libguile/hashtab.c b/libguile/hashtab.c
index 6141e4f..c4f2b5e 100644
--- a/libguile/hashtab.c
+++ b/libguile/hashtab.c
@@ -274,7 +274,7 @@ make_hash_table (int flags, unsigned long k, const char
*func_name)
SCM vector;
scm_t_hashtable *t;
int i = 0, n = k ? k : 31;
- while (i < HASHTABLE_SIZE_N && n > hashtable_size[i])
+ while (i + 1 < HASHTABLE_SIZE_N && n > hashtable_size[i])
++i;
n = hashtable_size[i];
diff --git a/libguile/numbers.c b/libguile/numbers.c
index 5aeced6..14f4af1 100644
--- a/libguile/numbers.c
+++ b/libguile/numbers.c
@@ -1500,8 +1500,6 @@ SCM_PRIMITIVE_GENERIC (scm_ceiling_quotient,
"ceiling-quotient", 2, 0, 0,
if (SCM_LIKELY (xx >= 0))
xx1 = xx + yy - 1;
}
- else if (SCM_UNLIKELY (yy == 0))
- scm_num_overflow (s_scm_ceiling_quotient);
else if (xx < 0)
xx1 = xx + yy + 1;
qq = xx1 / yy;
diff --git a/libguile/read.c b/libguile/read.c
index ee50fb4..6fee118 100644
--- a/libguile/read.c
+++ b/libguile/read.c
@@ -408,7 +408,7 @@ scm_read_sexp (scm_t_wchar chr, SCM port)
/* See above note about scm_sym_dot. */
if (c == '.' && scm_is_eq (scm_sym_dot, tmp))
{
- SCM_SETCDR (tl, tmp = scm_read_expression (port));
+ SCM_SETCDR (tl, scm_read_expression (port));
c = flush_ws (port, FUNC_NAME);
if (terminating_char != c)
diff --git a/libguile/script.c b/libguile/script.c
index 83dcdd5..5e0685a 100644
--- a/libguile/script.c
+++ b/libguile/script.c
@@ -317,6 +317,7 @@ scm_get_meta_args (int argc, char **argv)
switch (getc (f))
{
case EOF:
+ free (nargv);
return 0L;
default:
continue;
@@ -324,6 +325,7 @@ scm_get_meta_args (int argc, char **argv)
goto found_args;
}
found_args:
+ /* FIXME: we leak the result of calling script_read_arg. */
while ((narg = script_read_arg (f)))
if (!(nargv = (char **) realloc (nargv,
(1 + ++nargc) * sizeof (char *))))
diff --git a/libguile/stacks.c b/libguile/stacks.c
index 86188f4..d0e82f7 100644
--- a/libguile/stacks.c
+++ b/libguile/stacks.c
@@ -184,11 +184,10 @@ narrow_stack (SCM stack, long inner, SCM inner_key, long
outer, SCM outer_key)
else
{
/* Cut specified number of frames. */
- for (; outer && len ; --outer)
- {
- frame = scm_stack_ref (stack, scm_from_long (len - 1));
- len--;
- }
+ if (outer < len)
+ len -= outer;
+ else
+ len = 0;
}
SCM_SET_STACK_LENGTH (stack, len);
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-34-g0f75cc7,
Andy Wingo <=