ILASM/ILDASM bug(?)

G

gpsmobiler

Hi,

I found through a lot of exhausting searching, that the following C#
code will cause the IL code below:

const byte ICON_MONO12BY12 =0;

....... IL-file....
.field literal private static unsigned int8 'a' = uint8 (0)

When ILASM tries to compile the IL code, I get this error:
error : syntax error at token 'uint8' in: .field literal public
static unsigned int8 'a' = uint8 (0)

If I change my C# code to use 'const sbyte ...' then it works.

Does anyone know if there is a fix for this bug? (somewhere to get
better ILASM/ILDASM executables?)
 
M

Mattias Sjögren

I found through a lot of exhausting searching, that the following C#
code will cause the IL code below:

const byte ICON_MONO12BY12 =0;

...... IL-file....
.field literal private static unsigned int8 'a' = uint8 (0)

I can't reproduce this. Which version of Ildasm and Ilasm are you
using? The output I get is

..field private static literal unsigned int8 ICON_MONO12BY12 =
int8(0x00)

from the Ildasm v1.1 and

..field private static literal uint8 ICON_MONO12BY12 = uint8(0x00)

from the 2.0 version. Note that uint8 is only a keyword in 2.0, in
previous version you used 'unsigned int8'.


Mattias
 
G

gpsmobiler

Mattias said:
.field private static literal unsigned int8 ICON_MONO12BY12 =
int8(0x00)

from the Ildasm v1.1 and

.field private static literal uint8 ICON_MONO12BY12 = uint8(0x00)

from the 2.0 version. Note that uint8 is only a keyword in 2.0, in
previous version you used 'unsigned int8'.

I have ildasm v2.x. I'm getting this problem with the annoying
Dotfrustrator Community Edition. It seems it has an ilasm embedded in
it somewhere, because I can't find it in my filesystem. I can't check
it's version, but it is probably 1.1, thus the conflict.

Do you know where I can download ildasm v1.1?
 
G

gpsmobiler

I'm not aware of what this option does, but it is being used (by
Dotfrustrator Community Edition, which is the source of all this
stress).
 
G

Guest

I'm not aware of what this option does, but it is being used (by
Dotfrustrator Community Edition, which is the source of all this
stress).

The ildasm command line help (ildasm /? at the command prompt) gives:

/QUOTEALLNAMES Include all names into single quotes.

So, you coded this:

const byte ICON_MONO12BY12 =0;

The obfuscator changed "CON_MONO12BY12"to "a", and then QUOTEALLNAMES added
the single quotes to yield:

.field literal private static unsigned int8 'a' = uint8 (0)

I'm fairly confident that this explains what went wrong. I'm not sure what
to do about it - no experience with obfuscator and limited experience with
ildasm/ilasm. Maybe you can turn the option off. Maybe you can tell ilasm
to expect single quotes. I thinik this is an obfuscator issue, not an IL
issue, so maybe a repost in a different forum might help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top