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

Commit

Permalink
Avoid instantiating abstract class (#27589)
Browse files Browse the repository at this point in the history
  • Loading branch information
cshung authored Nov 4, 2019
1 parent fd418f6 commit 0b44119
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,11 @@ private CorInfoHelpFunc getCastingHelper(ref CORINFO_RESOLVED_TOKEN pResolvedTok
private CorInfoHelpFunc getNewHelper(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, byte* pHasSideEffects = null)
{
TypeDesc type = HandleToObject(pResolvedToken.hClass);
MetadataType metadataType = type as MetadataType;
if (metadataType != null && metadataType.IsAbstract)
{
ThrowHelper.ThrowInvalidProgramException(ExceptionStringID.InvalidProgramSpecific, HandleToObject(callerHandle));
}

if (pHasSideEffects != null)
{
Expand Down

0 comments on commit 0b44119

Please sign in to comment.