blob: 9e422bbdab4f3fcff6b9fe1e677d96a69703157b (
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
// 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.
// leave into fault from catch
// expect throw System.InvalidProgramException
.assembly extern mscorlib { }
.assembly extern System.Console
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly test
{
.custom instance void [mscorlib]System.Security.AllowPartiallyTrustedCallersAttribute::.ctor() = ( 01 00 01 00 00 )
}
.module ver_fg_13.exe
.class private auto ansi beforefieldinit test
extends [mscorlib]System.Object
{
.method public static int32 Main() cil managed
{
.entrypoint
.locals init (int32 retval)
.try
{
call void test::test2()
ldstr "Fail"
call void [System.Console]System.Console::WriteLine(string)
ldc.i4 101
stloc retval
leave IL_01
}
catch [mscorlib]System.InvalidProgramException
{
pop
ldstr "Pass"
call void [System.Console]System.Console::WriteLine(string)
ldc.i4 100
stloc retval
leave IL_01
}
IL_01:
ldloc retval
ret
}
.method public hidebysig static void test2() cil managed
{
.try
{
newobj instance void [mscorlib]System.DivideByZeroException::.ctor()
throw
.try
{
ldstr "Test"
pop
leave IL_03
}
fault
{
ldstr "fault"
call void [System.Console]System.Console::WriteLine(string)
endfault
}
IL_03: leave IL_02
}
catch [mscorlib]System.DivideByZeroException
{
pop
leave -22
ldstr "Fail - b"
call void [System.Console]System.Console::WriteLine(string)
leave IL_02
}
IL_02: ret
}
}
|