}
*shadow = ENCODEOP(threadid, ourClock, id_to_int(writeThread), writeClock) | (shadowval & ATOMICMASK);
+
+ *old_val = shadowval;
+ *new_val = *shadow;
}
Exit:
if (race) {
assert_race(race);
else model_free(race);
}
-
-
- *old_val = shadowval;
- *new_val = *shadow;
}
static inline void raceCheckRead_otherIt(thread_id_t thread, const void * location, uint64_t first_shadowval, uint64_t updated_shadowval)
uint64_t *shadow = lookupAddressEntry(location);
uint64_t shadowval = *shadow;
- if (shadowval != 0 && shadowval == first_shadowval) {
+ if (shadowval == first_shadowval) {
*shadow = updated_shadowval;
return;
}
void raceCheckRead64(thread_id_t thread, const void *location)
{
uint64_t old_shadowval, new_shadowval;
- old_shadowval = new_shadowval = 0;
+ old_shadowval = new_shadowval = INVALIDSHADOWVAL;
raceCheckRead_firstIt(thread, location, &old_shadowval, &new_shadowval);
raceCheckRead_otherIt(thread, (const void *)(((uintptr_t)location) + 1), old_shadowval, new_shadowval);
void raceCheckRead32(thread_id_t thread, const void *location)
{
uint64_t old_shadowval, new_shadowval;
- old_shadowval = new_shadowval = 0;
+ old_shadowval = new_shadowval = INVALIDSHADOWVAL;
raceCheckRead_firstIt(thread, location, &old_shadowval, &new_shadowval);
raceCheckRead_otherIt(thread, (const void *)(((uintptr_t)location) + 1), old_shadowval, new_shadowval);
void raceCheckRead16(thread_id_t thread, const void *location)
{
uint64_t old_shadowval, new_shadowval;
- old_shadowval = new_shadowval = 0;
+ old_shadowval = new_shadowval = INVALIDSHADOWVAL;
raceCheckRead_firstIt(thread, location, &old_shadowval, &new_shadowval);
raceCheckRead_otherIt(thread, (const void *)(((uintptr_t)location) + 1), old_shadowval, new_shadowval);
void raceCheckRead8(thread_id_t thread, const void *location)
{
uint64_t old_shadowval, new_shadowval;
- old_shadowval = new_shadowval = 0;
+ old_shadowval = new_shadowval = INVALIDSHADOWVAL;
raceCheckRead_firstIt(thread, location, &old_shadowval, &new_shadowval);
}
ShadowExit:
*shadow = ENCODEOP(0, 0, threadid, ourClock);
+
+ *old_val = shadowval;
+ *new_val = *shadow;
}
Exit:
assert_race(race);
else model_free(race);
}
-
- *old_val = shadowval;
- *new_val = *shadow;
}
static inline void raceCheckWrite_otherIt(thread_id_t thread, void * location, uint64_t first_shadowval, uint64_t updated_shadowval)
uint64_t *shadow = lookupAddressEntry(location);
uint64_t shadowval = *shadow;
- if (shadowval != 0 && shadowval == first_shadowval) {
+ if (shadowval == first_shadowval) {
*shadow = updated_shadowval;
return;
}
void raceCheckWrite64(thread_id_t thread, void *location)
{
uint64_t old_shadowval, new_shadowval;
- old_shadowval = new_shadowval = 0;
+ old_shadowval = new_shadowval = INVALIDSHADOWVAL;
raceCheckWrite_firstIt(thread, location, &old_shadowval, &new_shadowval);
raceCheckWrite_otherIt(thread, (void *)(((uintptr_t)location) + 1), old_shadowval, new_shadowval);
void raceCheckWrite32(thread_id_t thread, void *location)
{
uint64_t old_shadowval, new_shadowval;
- old_shadowval = new_shadowval = 0;
+ old_shadowval = new_shadowval = INVALIDSHADOWVAL;
raceCheckWrite_firstIt(thread, location, &old_shadowval, &new_shadowval);
raceCheckWrite_otherIt(thread, (void *)(((uintptr_t)location) + 1), old_shadowval, new_shadowval);
void raceCheckWrite16(thread_id_t thread, void *location)
{
uint64_t old_shadowval, new_shadowval;
- old_shadowval = new_shadowval = 0;
+ old_shadowval = new_shadowval = INVALIDSHADOWVAL;
raceCheckWrite_firstIt(thread, location, &old_shadowval, &new_shadowval);
raceCheckWrite_otherIt(thread, (void *)(((uintptr_t)location) + 1), old_shadowval, new_shadowval);
void raceCheckWrite8(thread_id_t thread, void *location)
{
uint64_t old_shadowval, new_shadowval;
- old_shadowval = new_shadowval = 0;
+ old_shadowval = new_shadowval = INVALIDSHADOWVAL;
raceCheckWrite_firstIt(thread, location, &old_shadowval, &new_shadowval);
}