Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 0a8cae7

Browse files
authored
Make StubHelpers::ProcessByrefValidationList NOTHROW (#6258)
This change fixes StubHelpers::ProcessByrefValidationList so that it doesn't throw. While there was a EX_TRY / EX_CATCH, the catch handler calls FormatValidationMessage to format the message before aborting the process and that function can throw. The fix is to wrap the inside of the EX_CATCH in one more EX_TRY / EX_CATCH and abort the process without message if there is an exception in the FormatValidationMessage.
1 parent c93479b commit 0a8cae7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/vm/stubhelpers.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,16 @@ void StubHelpers::ProcessByrefValidationList()
168168
}
169169
EX_CATCH
170170
{
171-
FormatValidationMessage(entry.pMD, errorString);
172-
EEPOLICY_HANDLE_FATAL_ERROR_WITH_MESSAGE(COR_E_EXECUTIONENGINE, errorString.GetUnicode());
171+
EX_TRY
172+
{
173+
FormatValidationMessage(entry.pMD, errorString);
174+
EEPOLICY_HANDLE_FATAL_ERROR_WITH_MESSAGE(COR_E_EXECUTIONENGINE, errorString.GetUnicode());
175+
}
176+
EX_CATCH
177+
{
178+
EEPOLICY_HANDLE_FATAL_ERROR(COR_E_EXECUTIONENGINE);
179+
}
180+
EX_END_CATCH_UNREACHABLE;
173181
}
174182
EX_END_CATCH_UNREACHABLE;
175183

0 commit comments

Comments
 (0)