Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix bug in recurive call of compare_heap_area_with_type
authorGabriel Corona <gabriel.corona@loria.fr>
Mon, 6 Jan 2014 13:58:48 +0000 (14:58 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Mon, 6 Jan 2014 13:58:48 +0000 (14:58 +0100)
When comparing arrays, the number of elements of the array was passed instead of the size of the elements.

src/xbt/mmalloc/mm_diff.c

index 49c5968..101b9f4 100644 (file)
@@ -842,9 +842,9 @@ static int compare_heap_area_with_type(void *real_area1, void *real_area2, void
     }
     for(i=0; i<type->size; i++){ 
       if(switch_types)
     }
     for(i=0; i<type->size; i++){ 
       if(switch_types)
-        res = compare_heap_area_with_type((char *)real_area1 + (i*elm_size), (char *)real_area2 + (i*elm_size), (char *)area1 + (i*elm_size), (char *)area2 + (i*elm_size), previous, other_types, all_types, type->dw_type_id, type->size, check_ignore, pointer_level);
+        res = compare_heap_area_with_type((char *)real_area1 + (i*elm_size), (char *)real_area2 + (i*elm_size), (char *)area1 + (i*elm_size), (char *)area2 + (i*elm_size), previous, other_types, all_types, type->dw_type_id, subtype->size, check_ignore, pointer_level);
       else
       else
-        res = compare_heap_area_with_type((char *)real_area1 + (i*elm_size), (char *)real_area2 + (i*elm_size), (char *)area1 + (i*elm_size), (char *)area2 + (i*elm_size), previous, all_types, other_types, type->dw_type_id, type->size, check_ignore, pointer_level);
+        res = compare_heap_area_with_type((char *)real_area1 + (i*elm_size), (char *)real_area2 + (i*elm_size), (char *)area1 + (i*elm_size), (char *)area2 + (i*elm_size), previous, all_types, other_types, type->dw_type_id, subtype->size, check_ignore, pointer_level);
       if(res == 1)
         return res;
     }
       if(res == 1)
         return res;
     }