[Vm-dev] Integer overflow with BitBlt rule 20 and depth 32

David T. Lewis lewis at mail.msen.com
Fri Oct 23 02:05:59 UTC 2009


On Thu, Oct 22, 2009 at 11:15:30AM -0300, Juan Vuletich wrote:
> 
> I believe we need to add explicit declarations of all variables being 
> unsigned. Or perhaps enhance a bit the code generator, by allowing a 
> plugin to declare its default numeric type. For BitBlt it could be 
> unsigned. For DSP stuff it could be float or double, making the Slang 
> code much nicer by not needing all the explicit type declarations. What 
> do you think?

For most plugins, adding the explicit declarations for variables and
method returns is sufficient, and takes care of the problem very well.
For BitBlt it looks like it would be a lot of very tedious work. Does
anyone have a code generator enhancement that would implement the
default numeric type idea?

The current default data type of sqInt is safe to use for object
references for both 32 bit and 64 bit object memory. An implementation
of default numeric types for plugins would need to be careful about
method return declarations. If a method returns an object reference,
it cannot be declared as int or long.

If the goal is to fix issues in BitBlt, my guess is that the fastest
way to get this done is to just grind through it and do all of the
explicit type declarations for variables and method returns. It would
take a few hours to do the work, but once it's done it's done.

Dave
 


More information about the Vm-dev mailing list