Skip to content

Commit f1b9245

Browse files
committed
tsan: fix GCC warnings
Fixes: tsan/tsan_shadow.h:93:32: warning: enumerated and non-enumerated type in conditional expression [-Wextra] tsan/tsan_shadow.h:94:44: warning: enumerated and non-enumerated type in conditional expression [-Wextra] Differential Revision: https://reviews.llvm.org/D124828
1 parent b34ea97 commit f1b9245

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

compiler-rt/lib/tsan/rtl/tsan_shadow.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,13 @@ class Shadow {
8888
if (size)
8989
*size = part_.access_ == kFreeAccess ? kShadowCell
9090
: __builtin_popcount(part_.access_);
91-
if (typ)
92-
*typ = (part_.is_read_ ? kAccessRead : kAccessWrite) |
93-
(part_.is_atomic_ ? kAccessAtomic : 0) |
94-
(part_.access_ == kFreeAccess ? kAccessFree : 0);
91+
if (typ) {
92+
*typ = part_.is_read_ ? kAccessRead : kAccessWrite;
93+
if (part_.is_atomic_)
94+
*typ |= kAccessAtomic;
95+
if (part_.access_ == kFreeAccess)
96+
*typ |= kAccessFree;
97+
}
9598
}
9699

97100
ALWAYS_INLINE

0 commit comments

Comments
 (0)