summaryrefslogtreecommitdiff
path: root/dbg_mlc.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2008-09-11 03:37:57 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:43 +0200
commit9567fad48b54e60255aa52f60bc43af95da77b33 (patch)
treec9fb0ca314c9f1fcc0a2bcb276cdfe75895d9562 /dbg_mlc.c
parent2ceea97cdf78c8a1c575a5002457d7cd648e740e (diff)
2008-09-10 Hans Boehm <Hans.Boehm@hp.com>
* dbg_mlc.c (GC_print_smashed_obj): Increase robustness with smashed string, (GC_debug_free_inner): Mark as free. * mallocx.c (GC_malloc_many): Always clear new block if GC_debugging_started. * reclaim.c: Move GC_debugging_started from GC_reclaim_small_nonempty_block() to GC_reclaim_generic(), which is also called directly. * doc/README: Fix spelling error. Update license summary. * include/gc.h (GC_PRE_INCR3, GC_POST_INCR3): add (void **) casts. * tests/test.c: Don't define GC_DEBUG if already defined.
Diffstat (limited to 'dbg_mlc.c')
-rw-r--r--dbg_mlc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/dbg_mlc.c b/dbg_mlc.c
index 7b23b52..a09bd54 100644
--- a/dbg_mlc.c
+++ b/dbg_mlc.c
@@ -420,7 +420,9 @@ STATIC void GC_print_smashed_obj(ptr_t p, ptr_t clobbered_addr)
GC_err_printf("<smashed>, appr. sz = %ld)\n",
(GC_size((ptr_t)ohdr) - DEBUG_BYTES));
} else {
- if (ohdr -> oh_string[0] == '\0') {
+ if ((word)(ohdr -> oh_string) < HBLKSIZE) {
+ GC_err_puts("(smashed string)");
+ } else if (ohdr -> oh_string[0] == '\0') {
GC_err_puts("EMPTY(smashed?)");
} else {
GC_err_puts(ohdr -> oh_string);
@@ -758,7 +760,11 @@ extern void GC_free_inner(void * p);
/* Used internally; we assume it's called correctly. */
void GC_debug_free_inner(void * p)
{
- GC_free_inner(GC_base(p));
+ ptr_t base = GC_base(p);
+ GC_ASSERT((ptr_t)p - (ptr_t)base == sizeof(oh));
+ /* Invalidate size */
+ ((oh *)base) -> oh_sz = GC_size(base);
+ GC_free_inner(base);
}
#endif