Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,9 @@ static morder to_morder(int mo) {
// since we use __sync_ atomics for actual atomic operations,
// we can safely ignore it as well. It also subtly affects semantics,
// but we don't model the difference.
return static_cast<morder>(mo & 0x7fff);
morder res = static_cast<morder>(static_cast<u8>(mo));
DCHECK_LE(res, mo_seq_cst);
return res;
}

# define ATOMIC_IMPL(func, mo, ...) \
Expand Down
Loading