File: call_missing_class.il

package info (click to toggle)
mono 4.6.2.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 778,148 kB
  • ctags: 914,052
  • sloc: cs: 5,779,509; xml: 2,773,713; ansic: 432,645; sh: 14,749; makefile: 12,361; perl: 2,488; python: 1,434; cpp: 849; asm: 531; sql: 95; sed: 16; php: 1
file content (98 lines) | stat: -rw-r--r-- 2,238 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98

//  CIL which breaks the ECMA-335 rules. 
// this CIL should fail verification by a conforming CLI verifier.

.assembly 'call_missing_class_generated'
{
  .hash algorithm 0x00008004
  .ver  0:0:0:0
}

.class public auto ansi beforefieldinit MissingMember extends [mscorlib]System.Object
{
	.method public hidebysig  specialname  rtspecialname instance default void .ctor ()  cil managed 
    	{
		.maxstack 8
		ldarg.0 
		call instance void object::.ctor()
		ret 
	}

	.method static private hidebysig void PrivateMethod ()  cil managed 
    	{
		.maxstack 8
		ret 
	}


	.field private int32 privateField
}

.class public auto ansi beforefieldinit Driver extends [mscorlib]System.Object
{
	.method public hidebysig  specialname  rtspecialname instance default void .ctor ()  cil managed 
    	{
		.maxstack 8
		ldarg.0 
		call instance void object::.ctor()
		ret 
	}

	.method public static void NoInline() cil managed
	{
		.maxstack 8
		ret
	}

	.method public static void TestMethod() cil managed
	{
		.maxstack 8
		call void Driver::NoInline()
		call int32 [mscorlib]MissingClass::Method()

		leave END
END:
		ret
	}

	.method public static int32 Main() cil managed
	{
		.entrypoint
		.maxstack 8
		.locals init ( class [mscorlib]System.Exception	V_0, int32 V_1)

		ldc.i4.0
		stloc.1

		.try {
			call void Driver::TestMethod()
			ldstr ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>call_missing_class did not throw an exception"
			call void class [mscorlib]System.Console::WriteLine(string)
			ldc.i4.1 
			stloc.1
			leave END
		}
		catch [mscorlib]System.Exception {
			stloc.0

			ldloc.0
			callvirt instance class [mscorlib]System.Type class [mscorlib]System.Exception::GetType()
			ldtoken [mscorlib]System.TypeLoadException
			call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
			beq ARE_EQUAL
			ldstr ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>call_missing_class thrown {0} instead of System.TypeLoadException"
			ldloc.0 
			callvirt instance class [mscorlib]System.Type class [mscorlib]System.Exception::GetType()
			call void class [mscorlib]System.Console::WriteLine(string, object)
			ldc.i4.1 
			stloc.1
ARE_EQUAL:
			leave END
		}


END:
		ldloc.1
		ret
	}
}