Skip to content

Commit 913e299

Browse files
authored
[NFC][tsan] Use the result of placement new (#86341)
1 parent 4652ec0 commit 913e299

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,8 @@ void ThreadStart(ThreadState *thr, Tid tid, tid_t os_id,
200200
}
201201

202202
void ThreadContext::OnStarted(void *arg) {
203-
thr = static_cast<ThreadState *>(arg);
204203
DPrintf("#%d: ThreadStart\n", tid);
205-
new (thr) ThreadState(tid);
204+
thr = new (arg) ThreadState(tid);
206205
if (common_flags()->detect_deadlocks)
207206
thr->dd_lt = ctx->dd->CreateLogicalThread(tid);
208207
thr->tctx = this;

0 commit comments

Comments
 (0)