Skip to content

Commit 39d4138

Browse files
authored
Fix access violation when reporting fatal errors during startup (#121602)
Fixes #121596
1 parent 6b5b847 commit 39d4138

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/coreclr/vm/threads.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6873,6 +6873,12 @@ BOOL ThreadStore::HoldingThreadStore(Thread *pThread)
68736873
}
68746874
CONTRACTL_END;
68756875

6876+
// This can be called early during startup from HandleFatalError
6877+
if (s_pThreadStore == NULL)
6878+
{
6879+
return FALSE;
6880+
}
6881+
68766882
if (pThread)
68776883
{
68786884
return (pThread == s_pThreadStore->m_HoldingThread);

0 commit comments

Comments
 (0)