dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] ilasm errors when local variable name is IL keyword


From: Radek Polak
Subject: [Pnet-developers] ilasm errors when local variable name is IL keyword
Date: Mon, 19 Mar 2007 07:04:26 +0100
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)

Hi all,
i am implementing local variable names in debug section. There is already support for this in ilasm - you can check docs and ilasm_grammar.y for details.

In short: local variable name and index can be outputted in method body using keyword .locals

.locals <str=0>

Until now everything works and you can compile such code with ilasm. But when your local variable has name e.g. after IL instruction ilasm will error. In attached example it's on this line:

.locals <box=0>

It would be great if somebody with compiler knowledge could help me with this.

Thanks

Radek
.assembly extern 'mscorlib'
{
        .ver 2:0:0:0
}
.assembly '<Assembly>'
{
        .ver 0:0:0:0
}
.module '<Module>'
.class private auto ansi 'C' extends ['mscorlib']'System'.'Object'
{
.line 1 "simple.cs"
.method private static hidebysig void 'Main'() cil managed 
{
        .locals init    (class ['mscorlib']'System'.'String')
.locals <box=0>
.line 5 "simple.cs"
        ldstr   "abc"
        stloc.0
.line 6 "simple.cs"
        ldloc.0
        call    void ['mscorlib']'System'.'Console'::'WriteLine'(class 
['mscorlib']'System'.'String')
        ret
        .maxstack 1
} // method Main
.method public hidebysig specialname rtspecialname instance void '.ctor'() cil 
managed 
{
        ldarg.0
        call    instance void ['mscorlib']'System'.'Object'::'.ctor'()
        ret
        .maxstack 1
} // method .ctor
} // class C

reply via email to

[Prev in Thread] Current Thread [Next in Thread]