/
constraints-load.il
212 lines (188 loc) · 6 KB
/
constraints-load.il
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
.assembly extern mscorlib
{
.ver 2:0:0:0
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
}
.assembly 'dd'
{
.custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::'.ctor'() = (
01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.module dd.exe // GUID = {7278218D-519A-4CA2-B185-7B5A5A3F17E7}
.class public auto ansi beforefieldinit Foo`1<(class [mscorlib]System.BrokenIComparable`1<!T>) T>
extends [mscorlib]System.Object
{
// method line 1
.method public hidebysig specialname rtspecialname
instance default void '.ctor' () cil managed
{
// Method begins at RVA 0x20ec
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void object::'.ctor'()
IL_0006: ret
} // end of method Foo`1::.ctor
// method line 2
.method public hidebysig
instance default string Test () cil managed
{
// Method begins at RVA 0x20f4
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldnull
IL_0001: ret
} // end of method Foo`1::Test
} // end of class Foo`1
.class public auto ansi beforefieldinit Foo
extends [mscorlib]System.Object
{
// method line 3
.method public hidebysig specialname rtspecialname
instance default void '.ctor' () cil managed
{
// Method begins at RVA 0x20f8
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void object::'.ctor'()
IL_0006: ret
} // end of method Foo::.ctor
// method line 4
.method public hidebysig
instance default string Test<(class [mscorlib]System.BrokenIComparable`1<!!T>) T> () cil managed
{
// Method begins at RVA 0x2100
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldnull
IL_0001: ret
} // end of method Foo::Test
} // end of class Foo
.class public auto ansi abstract sealed beforefieldinit Driver
extends [mscorlib]System.Object
{
// method line 5
.method private static hidebysig
default void UseBrokenMethod () cil managed
{
// Method begins at RVA 0x2104
// Code size 12 (0xc)
.maxstack 8
IL_0000: newobj instance void class Foo::'.ctor'()
IL_0005: callvirt instance string class Foo::Test<int32> ()
IL_000a: pop
IL_000b: ret
} // end of method Driver::UseBrokenMethod
// method line 6
.method private static hidebysig
default void UseBrokenType () cil managed
{
// Method begins at RVA 0x2114
// Code size 12 (0xc)
.maxstack 8
IL_0000: newobj instance void class Foo`1<int32>::'.ctor'()
IL_0005: callvirt instance string class Foo`1<int32>::Test()
IL_000a: pop
IL_000b: ret
} // end of method Driver::UseBrokenType
// method line 7
.method private static hidebysig
default void TestMethod () cil managed
{
// Method begins at RVA 0x2124
// Code size 47 (0x2f)
.maxstack 10
.locals init (
class [mscorlib]System.Type V_0,
class [mscorlib]System.Reflection.MethodInfo V_1,
class [mscorlib]System.Type V_2,
class [mscorlib]System.Type V_3)
IL_0000: ldtoken Foo
IL_0005: call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_000a: stloc.0
IL_000b: ldloc.0
IL_000c: ldstr "Test"
IL_0011: callvirt instance class [mscorlib]System.Reflection.MethodInfo class [mscorlib]System.Type::GetMethod(string)
IL_0016: stloc.1
IL_0017: ldloc.1
IL_0018: callvirt instance class [mscorlib]System.Type[] class [mscorlib]System.Reflection.MethodInfo::GetGenericArguments()
IL_001d: ldc.i4.0
IL_001e: ldelem.ref
IL_001f: stloc.2
IL_0020: ldloc.2
IL_0021: callvirt instance class [mscorlib]System.Type[] class [mscorlib]System.Type::GetGenericParameterConstraints()
IL_0026: ldc.i4.0
IL_0027: ldelem.ref
IL_0028: stloc.3
IL_0029: call void class Driver::UseBrokenMethod()
IL_002e: ret
} // end of method Driver::TestMethod
// method line 8
.method private static hidebysig
default void TestClass () cil managed
{
// Method begins at RVA 0x2160
// Code size 35 (0x23)
.maxstack 8
.locals init (
class [mscorlib]System.Type V_0,
class [mscorlib]System.Type V_1,
class [mscorlib]System.Type V_2)
IL_0000: ldtoken Foo`1
IL_0005: call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_000a: stloc.0
IL_000b: ldloc.0
IL_000c: callvirt instance class [mscorlib]System.Type[] class [mscorlib]System.Type::GetGenericArguments()
IL_0011: ldc.i4.0
IL_0012: ldelem.ref
IL_0013: stloc.1
IL_0014: ldloc.1
IL_0015: callvirt instance class [mscorlib]System.Type[] class [mscorlib]System.Type::GetGenericParameterConstraints()
IL_001a: ldc.i4.0
IL_001b: ldelem.ref
IL_001c: stloc.2
IL_001d: call void class Driver::UseBrokenType()
IL_0022: ret
} // end of method Driver::TestClass
// method line 9
.method public static hidebysig
default int32 Main () cil managed
{
// Method begins at RVA 0x2190
.entrypoint
// Code size 50 (0x32)
.maxstack 4
.locals init (
int32 V_0)
.try { // 1
IL_0000: call void class Driver::TestMethod()
IL_0005: ldc.i4.1
IL_0006: stloc.0
IL_0007: leave IL_0030
IL_000c: leave IL_0017
} // end .try 1
catch class [mscorlib]System.TypeLoadException { // 1
IL_0011: pop
IL_0012: leave IL_0017
} // end handler 1
.try { // 0
IL_0017: call void class Driver::TestClass()
IL_001c: ldc.i4.2
IL_001d: stloc.0
IL_001e: leave IL_0030
IL_0023: leave IL_002e
} // end .try 0
catch class [mscorlib]System.TypeLoadException { // 0
IL_0028: pop
IL_0029: leave IL_002e
} // end handler 0
IL_002e: ldc.i4.0
IL_002f: ret
IL_0030: ldloc.0
IL_0031: ret
} // end of method Driver::Main
} // end of class Driver