From 5e829289d89dc08ac3b00bc7f978adfa990d3bc3 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Tue, 8 Jul 2014 15:12:00 +0200 Subject: [PATCH] [mc] Use mc_snapshot_region_memcmp() in compare_areas_with_type() --- src/mc/mc_compare.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/mc/mc_compare.cpp b/src/mc/mc_compare.cpp index bf0a7ecae3..cbaedb516c 100644 --- a/src/mc/mc_compare.cpp +++ b/src/mc/mc_compare.cpp @@ -103,12 +103,9 @@ static int compare_areas_with_type(struct mc_compare_state& state, case DW_TAG_enumeration_type: case DW_TAG_union_type: { - void* data1 = - mc_snapshot_read_region(real_area1, region1, alloca(type->byte_size), type->byte_size); - void* data2 = - mc_snapshot_read_region(real_area2, region2, alloca(type->byte_size), type->byte_size); - return (memcmp(data1, data2, type->byte_size) != 0); - break; + return mc_snapshot_region_memcmp( + real_area1, region1, real_area2, region2, + type->byte_size) != 0; } case DW_TAG_typedef: case DW_TAG_volatile_type: -- 2.20.1