forked from mono/mono
-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw MemberAccessException when abstract class is used with newobj i…
…nstruction
- Loading branch information
Showing
5 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
.assembly extern mscorlib {} | ||
|
||
.assembly 'newobj-abstract' {} | ||
|
||
.class private auto ansi beforefieldinit Program | ||
extends [mscorlib]System.Object | ||
{ | ||
.method public hidebysig static int32 Main() cil managed | ||
{ | ||
.entrypoint | ||
.locals init (int32 V_0) | ||
|
||
ldc.i4.1 | ||
stloc.0 | ||
.try | ||
{ | ||
call void Program::NewAbstract() | ||
leave.s leavetarget | ||
|
||
} // end .try | ||
catch [mscorlib]System.MemberAccessException | ||
{ | ||
pop | ||
ldc.i4.0 | ||
stloc.0 | ||
leave.s leavetarget | ||
} | ||
leavetarget: | ||
ldloc.0 | ||
ret | ||
} // end of method Program::Main | ||
|
||
.method public hidebysig static void NewAbstract() cil managed | ||
{ | ||
newobj instance void Foo::.ctor() | ||
call void [mscorlib]System.GC::KeepAlive(object) | ||
ret | ||
} | ||
|
||
.method public hidebysig specialname rtspecialname | ||
instance void .ctor() cil managed | ||
{ | ||
ldarg.0 | ||
call instance void [mscorlib]System.Object::.ctor() | ||
ret | ||
} | ||
|
||
} | ||
|
||
.class private abstract auto ansi beforefieldinit Foo | ||
extends [mscorlib]System.Object | ||
{ | ||
.method public hidebysig specialname rtspecialname | ||
instance void .ctor() cil managed | ||
{ | ||
ldarg.0 | ||
call instance void [mscorlib]System.Object::.ctor() | ||
ret | ||
} | ||
|
||
} |