void MC_region_destroy(mc_mem_region_t reg)
{
- if (reg)
+ if (!reg)
return;
//munmap(reg->data, reg->size);
{
mc_mem_region_t ref_reg =
mc_model_checker->parent_snapshot ? mc_model_checker->parent_snapshot->regions[type] : NULL;
- mc_mem_region_t new_reg = MC_region_new(type, start_addr, start_addr, size, ref_reg);
+ mc_mem_region_t new_reg = MC_region_new(type, start_addr, permanent_addr, size, ref_reg);
snapshot->regions[type] = new_reg;
return;
}
mc_mem_region_t ref_reg =
mc_model_checker->parent_snapshot ? mc_model_checker->parent_snapshot->privatization_regions[i] : NULL;
snapshot->privatization_regions[i] =
- MC_region_new(-1, mc_binary_info->start_rw, mappings[i], size_data_exe, ref_reg);
+ MC_region_new(-1, mc_binary_info->start_rw, smpi_privatisation_regions[i].address, size_data_exe, ref_reg);
}
- snapshot->privatization_index = loaded_page;
+ snapshot->privatization_index = smpi_loaded_page;
snapshot->regions[2] = NULL;
} else
#endif
parent_snapshot ? parent_snapshot->privatization_regions[i] : NULL);
}
}
- switch_data_segment(snapshot->privatization_index);
+ }
+ if(snapshot->privatization_index >= 0) {
+ smpi_switch_data_segment(snapshot->privatization_index);
}
#endif