Skip to content

Commit a67d568

Browse files
author
Mike McLaughlin
authored
Fix dump generation segfault in DAC (#58530)
Issue: #58525
1 parent 441271c commit a67d568

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/coreclr/vm/excep.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11518,8 +11518,9 @@ VOID ThrowBadFormatWorker(UINT resID, LPCWSTR imageName DEBUGARG(__in_z const ch
1151811518
msgStr += W(")");
1151911519
}
1152011520
#endif
11521-
1152211521
ThrowHR(COR_E_BADIMAGEFORMAT, msgStr);
11522+
#else // DACCESS_COMPILE
11523+
ThrowHR(COR_E_BADIMAGEFORMAT);
1152311524
#endif // #ifndef DACCESS_COMPILE
1152411525
}
1152511526

src/coreclr/vm/exceptmacros.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,12 @@ template <typename T>
508508
NOINLINE
509509
VOID ThrowBadFormatWorkerT(UINT resID, T * pImgObj DEBUGARG(__in_z const char *cond))
510510
{
511+
#ifdef DACCESS_COMPILE
512+
ThrowBadFormatWorker(resID, nullptr DEBUGARG(cond));
513+
#else
511514
LPCWSTR tmpStr = GetPathForErrorMessagesT(pImgObj);
512515
ThrowBadFormatWorker(resID, tmpStr DEBUGARG(cond));
516+
#endif
513517
}
514518

515519

0 commit comments

Comments
 (0)