blob: 33b5c7d2f1b84045d5939a2e5a1d6709163f7cdf (
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
|
.assembly extern System.Console
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly extern legacy library mscorlib {}
.assembly bleref { }
.method public static int32 f()
{
ldnull
ldnull
ble OUT
OUT:
ldc.i4 100
ret
}
.method public static int32 Main() cil managed
{
.entrypoint
.maxstack 5
.try
{
call int32 f()
leave.s FAIL
}
catch [mscorlib]System.Security.VerificationException
{
pop
leave.s PASS
}
FAIL:
ldstr "Should have caught System.Security.VerificationException"
call void [System.Console]System.Console::WriteLine(string)
ldstr "FAILED"
call void [System.Console]System.Console::WriteLine(string)
ldc.i4 1
ret
PASS:
ldstr "Caught System.Security.VerificationException as expected"
call void [System.Console]System.Console::WriteLine(string)
ldstr "PASSED"
call void [System.Console]System.Console::WriteLine(string)
ldc.i4 100
ret
}
|