Avoid seg fault in the case where ensureModel is called in cds_func_entry and then...
[c11tester.git] / datarace.cc
index 58c52dd63c7a80baf27f3017cc4c195054a8f524..dd88c2fe98f095d678e55c3dbf1162d98298b9d7 100644 (file)
@@ -256,6 +256,9 @@ void raceCheckWrite(thread_id_t thread, void *location)
        uint64_t *shadow = lookupAddressEntry(location);
        uint64_t shadowval = *shadow;
        ClockVector *currClock = get_execution()->get_cv(thread);
+       if (currClock == NULL)
+               return;
+
        struct DataRace * race = NULL;
        /* Do full record */
        if (shadowval != 0 && !ISSHORTRECORD(shadowval)) {
@@ -424,6 +427,9 @@ void raceCheckRead(thread_id_t thread, const void *location)
        uint64_t *shadow = lookupAddressEntry(location);
        uint64_t shadowval = *shadow;
        ClockVector *currClock = get_execution()->get_cv(thread);
+       if (currClock == NULL)
+               return;
+
        struct DataRace * race = NULL;
 
        /* Do full record */