Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Use mc_snapshot_region_memcmp() in compare_areas_with_type()
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 8 Jul 2014 13:12:00 +0000 (15:12 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 8 Jul 2014 13:12:00 +0000 (15:12 +0200)
src/mc/mc_compare.cpp

index bf0a7ec..cbaedb5 100644 (file)
@@ -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: