From 8e135c411dafdfe02f2bdbcd880d415e5625324a Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Tue, 26 Aug 2014 13:10:50 +0200 Subject: [PATCH 1/1] [mc] Fix bug in mmalloc_compare_heap() when a ungragmented block is handled as a fragmented one This bug was introduced by the commit of MMALLOC_TYPE_HEAPINFO. --- src/mc/mc_diff.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mc/mc_diff.c b/src/mc/mc_diff.c index bbda6d5bd4..988d8b5706 100644 --- a/src/mc/mc_diff.c +++ b/src/mc/mc_diff.c @@ -600,6 +600,12 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2) continue; } + // We currently do not match fragments with unfragmented blocks (maybe we should). + if (heapinfo2b->type == MMALLOC_TYPE_UNFRAGMENTED) { + i2++; + continue; + } + if (heapinfo2b->type < 0) { fprintf(stderr, "Unkown mmalloc block type.\n"); abort(); -- 2.20.1