[compiler-rt] 913e299 - [NFC][tsan] Use the result of placement new (#86341)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 22 15:11:30 PDT 2024
Author: Vitaly Buka
Date: 2024-03-22T15:11:26-07:00
New Revision: 913e29966bac5fec08998a1acc3e793f9b7bcc12
URL: https://github.com/llvm/llvm-project/commit/913e29966bac5fec08998a1acc3e793f9b7bcc12
DIFF: https://github.com/llvm/llvm-project/commit/913e29966bac5fec08998a1acc3e793f9b7bcc12.diff
LOG: [NFC][tsan] Use the result of placement new (#86341)
Added:
Modified:
compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp b/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
index 77488f84328542..06c34a2e438388 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
@@ -200,9 +200,8 @@ void ThreadStart(ThreadState *thr, Tid tid, tid_t os_id,
}
void ThreadContext::OnStarted(void *arg) {
- thr = static_cast<ThreadState *>(arg);
DPrintf("#%d: ThreadStart\n", tid);
- new (thr) ThreadState(tid);
+ thr = new (arg) ThreadState(tid);
if (common_flags()->detect_deadlocks)
thr->dd_lt = ctx->dd->CreateLogicalThread(tid);
thr->tctx = this;
More information about the llvm-commits
mailing list