Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Replace test-and-die with assert
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 19 Jun 2014 10:27:31 +0000 (12:27 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 19 Jun 2014 10:27:31 +0000 (12:27 +0200)
src/mc/mc_snapshot.c

index 20d7642..c3eb07c 100644 (file)
@@ -102,9 +102,8 @@ void* mc_snapshot_read_region(void* addr, mc_mem_region_t region, void* target,
 {
   uintptr_t offset = (uintptr_t) addr - (uintptr_t) region->start_addr;
 
-  if (addr < region->start_addr || (char*) addr+size >= (char*)region->start_addr+region->size) {
-    xbt_die("Trying to read out of the region boundary.");
-  }
+  xbt_assert(addr >= region->start_addr && (char*) addr+size < (char*)region->start_addr+region->size,
+    "Trying to read out of the region boundary.");
 
   // Linear memory region:
   if (region->data) {