summaryrefslogtreecommitdiff
path: root/headers.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-03-13 13:08:16 +0000
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 21:06:56 +0400
commit667fb0512a70f7756a2c64f0e71c03e1e49a8a4c (patch)
tree67a5fa56f2df6166f717bb634e2370db9091b73f /headers.c
parent35260b7ff2dc15a5194758ab6f3c73fbfb40acb3 (diff)
downloadbdwgc-667fb0512a70f7756a2c64f0e71c03e1e49a8a4c.tar.gz
2011-03-13 Ivan Maidanski <ivmai@mail.ru>
* dbg_mlc.c (GC_make_closure): Fix SEGV in case GC_malloc returns NULL. * dbg_mlc.c (GC_debug_register_finalizer, GC_debug_register_finalizer_no_order, GC_debug_register_finalizer_unreachable, GC_debug_register_finalizer_ignore_self): Handle out of memory case properly (similar to GC_register_finalizer_inner). * headers.c (GC_install_header): Handle the case when alloc_hdr() returns NULL. * os_dep.c (GC_get_maps_len): Defend against missing "maps" file. * pthread_support.c (GC_mark_thread): Place a dummy return statement (which uses "id" argument) before the actual use of "id" as an array index (to suppress a warning produced by some static code analysis tools). * win32_threads.c (GC_mark_thread): Ditto. * pthread_support.c (GC_thr_init): Abort (with the appropriate message) if out of memory.
Diffstat (limited to 'headers.c')
-rw-r--r--headers.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/headers.c b/headers.c
index 1f8a7c97..c4f5023c 100644
--- a/headers.c
+++ b/headers.c
@@ -261,10 +261,12 @@ GC_INNER struct hblkhdr * GC_install_header(struct hblk *h)
if (!get_index((word) h)) return(0);
result = alloc_hdr();
- SET_HDR(h, result);
-# ifdef USE_MUNMAP
+ if (result) {
+ SET_HDR(h, result);
+# ifdef USE_MUNMAP
result -> hb_last_reclaimed = (unsigned short)GC_gc_no;
-# endif
+# endif
+ }
return(result);
}