diff options
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | gc.c | 4 | ||||
-rw-r--r-- | gc.h | 2 | ||||
-rw-r--r-- | hash.c | 2 | ||||
-rw-r--r-- | lib.c | 3 | ||||
-rw-r--r-- | lib.h | 2 | ||||
-rw-r--r-- | unwind.c | 4 |
7 files changed, 28 insertions, 8 deletions
@@ -1,3 +1,22 @@ +2012-04-05 Kaz Kylheku <kaz@kylheku.com> + + Bunch of fixes. + + * gc.c (gc_mutated): Return the value. + + * gc.h (gc_mutated): Declaration updated. + + * hash.c (remhash): Fix unsafe assignment to use set macro. + + * lib.c (sort): Fix wrong use of mut macro on the list + before it is sorted rather than after. + + * lib.h (mut): Trivial version of macro updated to return argument. + + * unwind.c (uw_init): The toplevel environment's match_context + should be gc_protected. Though this is probably not used, + which is why it has not been a problem. + 2012-04-04 Kaz Kylheku <kaz@kylheku.com> * hash.c (hash_grow, gethash_l, gethash, gethash_f): Replace @@ -623,11 +623,11 @@ out: return val; } -void gc_mutated(val obj) +val gc_mutated(val obj) { if (backptr_idx >= BACKPTR_VEC_SIZE) gc(); - backptr[backptr_idx++] = obj; + return backptr[backptr_idx++] = obj; } val gc_push(val obj, val *plist) @@ -38,7 +38,7 @@ int gc_is_reachable(val); #if CONFIG_GEN_GC val gc_set(val *, val); val gc_push(val, val *); -void gc_mutated(val); +val gc_mutated(val); #endif void unmark(void); @@ -427,7 +427,7 @@ val remhash(val hash, val key) if (existing) { val loc = memq(existing, *pchain); - *pchain = nappend2(ldiff(*pchain, loc), cdr(loc)); + set(*pchain, nappend2(ldiff(*pchain, loc), cdr(loc))); h->count--; bug_unless (h->count >= 0); } @@ -3853,8 +3853,7 @@ val sort(val seq, val lessfun, val keyfun) objects. Sorting the list could reverse some of the pointers between the generations resulting in a backpointer. Thus we better inform the collector about this object. */ - mut(seq); - return sort_list(seq, lessfun, keyfun); + return mut(sort_list(seq, lessfun, keyfun)); } sort_vec(seq, lessfun, keyfun); @@ -235,7 +235,7 @@ val gc_set(val *, val); #define mpush(val, place) (gc_push(val, &(place))) #else #define set(place, val) ((place) = (val)) -#define mut(obj) +#define mut(obj) (obj) #define mpush(val, place) (push(val, &(place))) #endif @@ -403,7 +403,9 @@ void uw_continue(uw_frame_t *current, uw_frame_t *cont) void uw_init(void) { - protect(&toplevel_env.ev.func_bindings, &exception_subtypes, (val *) 0); + protect(&toplevel_env.ev.func_bindings, + &toplevel_env.ev.match_context, + &exception_subtypes, (val *) 0); exception_subtypes = cons(cons(t, nil), exception_subtypes); uw_register_subtype(type_error_s, error_s); uw_register_subtype(internal_error_s, error_s); |