X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e7173457dce01a608824b72d2e4ff62572d51d13..0f86d3285f605e43ba3f845eb2f5ee2502b2aed4:/src/mc/mc_compare.cpp diff --git a/src/mc/mc_compare.cpp b/src/mc/mc_compare.cpp index 0314dfca71..abeb22dc37 100644 --- a/src/mc/mc_compare.cpp +++ b/src/mc/mc_compare.cpp @@ -210,7 +210,7 @@ static int compare_areas_with_type(struct mc_compare_state& state, else if (region1->contain(simgrid::mc::remote(addr_pointed1))) { if (!region2->contain(simgrid::mc::remote(addr_pointed2))) return 1; - if (type->type_id.empty()) + if (!type->type_id) return (addr_pointed1 != addr_pointed2); else { return compare_areas_with_type(state, process_index, @@ -294,33 +294,28 @@ static int compare_global_variables(mc_object_info_t object_info, struct mc_compare_state state; - xbt_dynar_t variables; - int res; - unsigned int cursor = 0; - mc_variable_t current_var; + std::vector& variables = object_info->global_variables; - variables = object_info->global_variables; - - xbt_dynar_foreach(variables, cursor, current_var) { + for (simgrid::mc::Variable& current_var : variables) { // If the variable is not in this object, skip it: // We do not expect to find a pointer to something which is not reachable // by the global variables. - if ((char *) current_var->address < (char *) object_info->start_rw - || (char *) current_var->address > (char *) object_info->end_rw) + if ((char *) current_var.address < (char *) object_info->start_rw + || (char *) current_var.address > (char *) object_info->end_rw) continue; - mc_type_t bvariable_type = current_var->type; - res = + mc_type_t bvariable_type = current_var.type; + int res = compare_areas_with_type(state, process_index, - (char *) current_var->address, snapshot1, r1, - (char *) current_var->address, snapshot2, r2, + (char *) current_var.address, snapshot1, r1, + (char *) current_var.address, snapshot2, r2, bvariable_type, 0); if (res == 1) { XBT_TRACE3(mc, global_diff, -1, -1, current_var->name); XBT_VERB("Global variable %s (%p) is different between snapshots", - current_var->name.c_str(), - (char *) current_var->address); + current_var.name.c_str(), + (char *) current_var.address); return 1; }