~ chicken-core (chicken-5) 4f3e7c7ca683d7c8fc208f9632c77cc08f2eee9b


commit 4f3e7c7ca683d7c8fc208f9632c77cc08f2eee9b
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Aug 9 20:29:27 2010 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Mon Aug 9 20:29:27 2010 +0200

    fixed mean bug in creation of initial ptable

diff --git a/runtime.c b/runtime.c
index e41d9aa7..2e13f5a3 100644
--- a/runtime.c
+++ b/runtime.c
@@ -725,7 +725,8 @@ int CHICKEN_initialize(int heap, int stack, int symbols, void *toplevel)
 
 static C_PTABLE_ENTRY *create_initial_ptable()
 {
-  C_PTABLE_ENTRY *pt = (C_PTABLE_ENTRY *)C_malloc(sizeof(C_PTABLE_ENTRY) * 61); /* take note of this, it's subtle */
+  /* hardcoded table size - this must match the number of C_pte calls! */
+  C_PTABLE_ENTRY *pt = (C_PTABLE_ENTRY *)C_malloc(sizeof(C_PTABLE_ENTRY) * 64);
   int i = 0;
 
   if(pt == NULL)
@@ -794,7 +795,8 @@ static C_PTABLE_ENTRY *create_initial_ptable()
   C_pte(C_copy_closure);
   C_pte(C_dump_heap_state);
   C_pte(C_filter_heap_objects);
-  
+
+  /* did you remember the hardcoded pte table size? */
   pt[ i ].id = NULL;
   return pt;
 }
Trap