Skip to content

Commit

Permalink
Fix dump generation segfault in DAC (dotnet#58530)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikem8361 authored Sep 2, 2021
1 parent 441271c commit a67d568
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/coreclr/vm/excep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11518,8 +11518,9 @@ VOID ThrowBadFormatWorker(UINT resID, LPCWSTR imageName DEBUGARG(__in_z const ch
msgStr += W(")");
}
#endif

ThrowHR(COR_E_BADIMAGEFORMAT, msgStr);
#else // DACCESS_COMPILE
ThrowHR(COR_E_BADIMAGEFORMAT);
#endif // #ifndef DACCESS_COMPILE
}

Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/vm/exceptmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,12 @@ template <typename T>
NOINLINE
VOID ThrowBadFormatWorkerT(UINT resID, T * pImgObj DEBUGARG(__in_z const char *cond))
{
#ifdef DACCESS_COMPILE
ThrowBadFormatWorker(resID, nullptr DEBUGARG(cond));
#else
LPCWSTR tmpStr = GetPathForErrorMessagesT(pImgObj);
ThrowBadFormatWorker(resID, tmpStr DEBUGARG(cond));
#endif
}


Expand Down

0 comments on commit a67d568

Please sign in to comment.