diff options
author | Ludovic Courtès <ludo@gnu.org> | 2007-01-19 08:53:33 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2007-01-19 08:53:33 +0000 |
commit | 42ddb3cb8b30a2bba45c4ef9bf29d3ab04c6cc45 (patch) | |
tree | 4d79ba88b709060e510cf679826b5fa46583fc2d /libguile | |
parent | e5467c4d74348e81060ec81cff8f4d7a342adff0 (diff) | |
download | guile-42ddb3cb8b30a2bba45c4ef9bf29d3ab04c6cc45.tar.gz |
Changes from arch/CVS synchronization
Diffstat (limited to 'libguile')
-rw-r--r-- | libguile/ChangeLog | 11 | ||||
-rw-r--r-- | libguile/struct.c | 9 |
2 files changed, 16 insertions, 4 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog index cec0dda84..f62f11a74 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +2007-01-19 Ludovic Courtès <ludovic.courtes@laas.fr> + + * struct.c (scm_i_struct_equalp): Skip comparison if both FIELD1 + is equal to S1 and FIELD2 is equal to S2. This avoids infinite + recursion when comparing `s' fields, as the REQUIRED_VTABLE_FIELDS + added by `make-vtable-vtable'. Reported by Marco Maggi. + 2007-01-18 Han-Wen Nienhuys <hanwen@lilypond.org> * throw.c (scm_ithrow): more refined error message: print symbols @@ -128,10 +135,10 @@ 2006-12-12 Ludovic Courtès <ludovic.courtes@laas.fr> * libguile/unif.c (read_decimal_integer): Let RESP be SIGN * RES - instead of RES (reported by Gyula Szavai). This allows the use of + instead of RES (reported by Szavai Gyula). This allows the use of negative lower bounds. (scm_i_read_array): Make sure LEN is non-negative (reported by - Gyula Szavai). + Szavai Gyula). (scm_array_in_bounds_p): Iterate over S instead of always comparing indices with the bounds of S[0]. This fixes diff --git a/libguile/struct.c b/libguile/struct.c index de8667d45..69ec7e634 100644 --- a/libguile/struct.c +++ b/libguile/struct.c @@ -564,10 +564,15 @@ scm_i_struct_equalp (SCM s1, SCM s2) field1 = scm_struct_ref (s1, s_field_num); field2 = scm_struct_ref (s2, s_field_num); - if (scm_is_false (scm_equal_p (field1, field2))) - return SCM_BOOL_F; + /* Self-referencing fields (type `s') must be skipped to avoid infinite + recursion. */ + if (!(scm_is_eq (field1, s1) && (scm_is_eq (field2, s2)))) + if (scm_is_false (scm_equal_p (field1, field2))) + return SCM_BOOL_F; } + /* FIXME: Tail elements should be tested for equality. */ + return SCM_BOOL_T; } #undef FUNC_NAME |