> Hi Daniel,
>
[quoted text clipped - 12 lines]
> in
> the ECMA Standard."
Which says nothing about you undrstanding that its a verification rule, your
post came across as if you expected the code to simply not work. You never
mentioned actually trying to verify it using peverify or any other tool.
Remember no one can read your mind, you have to be explicit.
>> I suspect your examples are valid but unverifiable, try running peverify
>> on
[quoted text clipped - 5 lines]
> stores the "this" pointer in a local variable SHOULD be rejected by the
> verifier. This does *not* happen.
It should, yes, but that it does not is not a problem with the standard.
peverify is not what I would consider the definate standard, but only an
implementation of it, one that is apparently not complete at that.
I am curious, have you tried running your code under a user account that
doesn't grant rights to unverifiable code(ie not an Administrator?) If this
particular problem exists in the runtime as well as in peverify, then that
may well be a significant problem (it certainly allows some ugly hacks, if
nothing else).
Also, if you could post a complete example of your IL I'll take a whack at
it with the newest verifier I have available, it might have been a bug in
the 1.x framework(which framework are you using, btw?). Until we see the 2.0
standard(assuming there is one), its impossible to say that the rule is
still in effect, but I assume it should be.
George - 16 Apr 2005 09:06 GMT
Hi Daniel,
> Which says nothing about you undrstanding that its a verification rule, your
> post came across as if you expected the code to simply not work. You never
> mentioned actually trying to verify it using peverify or any other tool.
> Remember no one can read your mind, you have to be explicit.
Sorry, you are right - I was not explicit enough.
> It should, yes, but that it does not is not a problem with the standard.
> peverify is not what I would consider the definate standard, but only an
> implementation of it, one that is apparently not complete at that.
> I am curious, have you tried running your code under a user account that
> doesn't grant rights to unverifiable code(ie not an Administrator?)
I tried after you suggested it. And the answer is the same.
> Also, if you could post a complete example of your IL I'll take a whack at
> it with the newest verifier I have available, it might have been a bug in
> the 1.x framework(which framework are you using, btw?).
I'm using peverify 1.1.4322.573
Thank you very much for having a look at the code! Here is it:
==================================
// Microsoft (R) .NET Framework IL Disassembler. Version 1.1.4322.573
// Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) //
.z\V.4..
.ver 1:0:5000:0
}
.assembly Test113
{
// --- The following custom attribute is added automatically, do not
uncomment -------
// .custom instance void
[mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(bool,
//
bool) = ( 01 00 00 01 00 00 )
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.module Test113.exe
// MVID: {732B486A-F0FA-451D-A4C6-FBD9B16BFF9F}
.imagebase 0x00400000
.subsystem 0x00000003
.file alignment 512
.corflags 0x00000001
// Image base: 0x03020000
//
// ============== CLASS STRUCTURE DECLARATION ==================
//
.class private auto ansi beforefieldinit Test
extends [mscorlib]System.Object
{
} // end of class Test
.class private auto ansi beforefieldinit A
extends [mscorlib]System.Object
{
} // end of class A
// =============================================================
// =============== GLOBAL FIELDS AND METHODS ===================
// =============================================================
// =============== CLASS MEMBERS DECLARATION ===================
// note that class flags, 'extends' and 'implements' clauses
// are provided here for information only
.class private auto ansi beforefieldinit Test
extends [mscorlib]System.Object
{
.method private hidebysig static void Main() cil managed
{
.entrypoint
// Code size 9 (0x9)
.maxstack 3
.locals init (class A V_0)
IL_0000: ldc.i4.1
IL_0001: ldc.i4.3
IL_0002: newobj instance void A::.ctor(int32,
int32)
IL_0007: stloc.0
IL_0008: ret
} // end of method Test::Main
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// Code size 7 (0x7)
.maxstack 1
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
} // end of method Test::.ctor
} // end of class Test
.class private auto ansi beforefieldinit A
extends [mscorlib]System.Object
{
.method public hidebysig specialname rtspecialname
instance void .ctor(int32 i,
int32 j) cil managed
{
.maxstack 3
.locals init (class A V_0)
ldarg 0
ldarg.1
ldarg.2
add
call instance void A::.ctor(int32)
// here we store the this pointer into a local var.
// this should be allowed by verifier only if the this is initialized
ldarg 0
stloc 0
ret
} // end of method A::.ctor
.method public hidebysig specialname rtspecialname
instance void .ctor(int32 i) cil managed
{
.maxstack 3
ldarg.0
ldarg.1
ldarg.1
call instance void A::.ctor(int32,int32)
ret
} // end of method A::.ctor
} // end of class A