blob: 041673975b531e9f20704af2209ed4d63e6b47f1 (
plain)
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
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
.assembly extern legacy library mscorlib {}
.assembly extern System.Console
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly legacy library ldfldunboxedvt {}
.class public sequential ansi sealed beforefieldinit VT
extends [mscorlib]System.ValueType
{
.field public int32 a
} // end of class VT
.class private auto ansi beforefieldinit ldfldunboxedvt
extends [mscorlib]System.Object
{
.method public hidebysig static void f() cil managed
{
.maxstack 5
.locals init (valuetype VT V_0)
IL_0000: ldloca.s V_0
IL_0002: initobj VT
IL_0008: //ldloca.s V_0
ldloc.s V_0
IL_000a: ldfld int32 VT::a
IL_000f: call void [System.Console]System.Console::WriteLine(int32)
ret
}
.method public hidebysig static int32 Main() cil managed
{
.entrypoint
.maxstack 5
.try
{
call void ldfldunboxedvt::f()
leave.s PASS
}
catch [mscorlib]System.NullReferenceException
{
ldstr "FAIL - Caught an unexpected NullReferenceException"
call void [System.Console]System.Console::WriteLine(string)
leave.s FAIL
}
FAIL:
ldc.i4.s 1
ret
PASS:
ldstr "PASS"
call void [System.Console]System.Console::WriteLine(string)
ldc.i4.s 100
ret
} // end of method ldfldunboxedvt::Main
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
}
}
|