Skip to content

Commit 5f7dc8a

Browse files
authored
[compiler-rt][TSan] Fix TSan compile error on Android (#162369)
1 parent c95f5bb commit 5f7dc8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,8 @@ ThreadState *cur_thread() {
680680
// significant bit of TLS_SLOT_SANITIZER to 1. Scudo allocator uses this bit
681681
// as a flag to disable memory initialization. This is a workaround to get the
682682
// correct ThreadState pointer.
683-
reinterpret_cast<ThreadState*>(addr & ~1ULL);
683+
uptr addr = reinterpret_cast<uptr>(thr);
684+
return reinterpret_cast<ThreadState*>(addr & ~1ULL);
684685
}
685686

686687
void set_cur_thread(ThreadState *thr) {

0 commit comments

Comments
 (0)