Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/coreclr/dlls/mscorrc/mscorrc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ BEGIN
BFA_INVALID_TOKEN_IN_MANIFESTRES "Invalid token saved in ManifestResource."
BFA_EMPTY_ASSEMDEF_NAME "Empty assembly simple name."
BFA_BAD_IL "Bad IL format."
BFA_STRIPPED_IL_BODY "A method body required at runtime was stripped from the ReadyToRun image and this runtime has no JIT to compile it."
Comment thread
kotlarmilos marked this conversation as resolved.
Outdated
BFA_CLASSLOAD_VALUETYPEMISMATCH "Could not load type '%1' from assembly '%2' due to value type mismatch."
BFA_METHODDECL_NOT_A_METHODDEF "Method declaration is not a methoddef."
BFA_DUPLICATE_DELEGATE_METHOD "Duplicate definition for runtime implemented delegate method."
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/dlls/mscorrc/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@
#define IDS_EE_INTEROP_STUB_CA_NO_ACCESS_TO_STUB_METHOD 0x2111
#endif

#define BFA_STRIPPED_IL_BODY 0x2112
#define BFA_REFERENCE_ASSEMBLY 0x2113

#define IDS_E_FIELDACCESS 0x2114
Expand Down
11 changes: 11 additions & 0 deletions src/coreclr/vm/prestub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "comdelegate.h"
#include "dbginterface.h"
#include "stubgen.h"
#include "openum.h"
#include "eventtrace.h"
#include "array.h"
#include "ecall.h"
Expand Down Expand Up @@ -703,6 +704,16 @@ namespace
if (status == COR_ILMETHOD_DECODER::FORMAT_ERROR)
COMPlusThrowHR(COR_E_BADIMAGEFORMAT, BFA_BAD_IL);

Module* pModule = pMD->GetModule();
if (pModule->IsReadyToRun()
&& pModule->GetReadyToRunInfo()->HasStrippedILBodies()
&& pHeader->GetCodeSize() == 2
&& pHeader->Code[0] == CEE_LDNULL
&& pHeader->Code[1] == CEE_THROW)
{
Comment thread
kotlarmilos marked this conversation as resolved.
COMPlusThrowHR(COR_E_BADIMAGEFORMAT, BFA_STRIPPED_IL_BODY);
Comment thread
kotlarmilos marked this conversation as resolved.
Outdated
}
Comment thread
kotlarmilos marked this conversation as resolved.
Comment thread
kotlarmilos marked this conversation as resolved.
Comment thread
kotlarmilos marked this conversation as resolved.

return pHeader;
}

Expand Down
Loading