[Mono-dev] vbc compiler treats AscW as CInt with /novbruntimeref

Rolf Bjarne rolfbasura at ya.com
Mon Aug 28 04:11:29 EDT 2006


Hi,

I could only make it compile with the v1.1 vbc.exe, the v2.0 compiler  
fails with no error message, so I don't think this is a feature the VB  
runtime should use, since then it won't compile with vbc, only with vbnc.

Rolf

> Hi,
>
> If I compile the attached file:
> vbnc /target:library /novbruntimeref novbruntimeref.vb
>
> I get the result that calls to AscW are replaced with the first parameter
> passed to AscW but it is Integer on the stack.
>
> This replacement is done when:
> - /novbruntimeref is used
> - The called AscW is declared in the code being compiled
> - The called AscW is Shared (or is declared in a Module)
> - The first argument of the called AscW is ByVal Char
>
> Note that the return value and the other arguments of the called AscW are
> dropped and only the first parameter is preserved on the stack.
>
> Also note that this value is really Integer because invalid conversion
> causes error with type name Integer.
>
> I found this when tried to figure out why Convert.ToInt32 is required in
> AscW. I found no other such hacks (Asc, Chr, ChrW) and I think there are  
> no
> others.
>
> Implementing this in vbnc as well could help the VB runtime.
>
> Kornél



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.6/428 - Release Date: 25/08/2006




More information about the Mono-devel-list mailing list