On Wed, Jan 7, 2009 at 4:20 AM, Kevin Beranek <[email protected]> wrote:
> I've stumbled upon some interesting behavior of number->string. It
> appears that there was previously a ticket filed for a similar bug in
> version 2.6 (http://trac.callcc.org/ticket/160). What I've been
> observing doesn't seem to be exactly the same but it is perhaps related
> because I've only noticed it with base 2 as was the case with the
> previous bug.
>
Hi!
Attached a patch that should fix the problem. It happened only in
the case when a garbage collection occurred while allocating
the result. Thanks for reporting this!
cheers,
felix
Index: runtime.c
===================================================================
--- runtime.c (revision 12947)
+++ runtime.c (working copy)
@@ -514,7 +514,6 @@
static void cons_flonum_trampoline(void *dummy) C_noret;
static void gc_2(void *dummy) C_noret;
static void allocate_vector_2(void *dummy) C_noret;
-static void cons_string_trampoline(void *dummy) C_noret;
static void get_argv_2(void *dummy) C_noret;
static void make_structure_2(void *dummy) C_noret;
static void generic_trampoline(void *dummy) C_noret;
@@ -7838,12 +7837,6 @@
fini:
radix = C_strlen(p);
-
- if(!C_demand(C_bytestowords(radix) + 1)) {
- C_save(k);
- cons_string_trampoline(NULL);
- }
-
a = C_alloc((C_bytestowords(radix) + 1));
radix = C_string(&a, radix, p);
C_kontinue(k, radix);
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users