[Vm-dev] Mantis 0007265: Bug in Matrix2x3Plugin okayIntValue:
(was: two small bugs (vm related))
David T. Lewis
lewis at mail.msen.com
Tue Sep 15 02:24:56 UTC 2015
On Sun, Sep 13, 2015 at 07:17:51PM -0400, David T. Lewis wrote:
>
> On Sun, Sep 13, 2015 at 10:23:42PM +0200, Nicolai Hess wrote:
> >
> > I am about to close some old mantis reports.
> >
> > There are two issues related to the vm and easy to solve ( I think).
> >
> > http://bugs.squeak.org/view.php?id=7265
> >
> > 0007265: Bug in Matrix2x3Plugin okayIntValue:
> > Method
> > okayIntValue: value
> > uses argument to compare with lower bound, m23ResultX for upper bound.
> >
> > okayIntValue: value
> > ^(value >= -1073741824 asFloat and:[m23ResultX <= 1073741823 asFloat])
> >
> > should be:
> > okayIntValue: value
> > ^(value >= -1073741824 asFloat and:[value <= 1073741823 asFloat])
> >
> > I looked at the Matrix2x3Plugin code, and the wrong comparsion
> > is still there.
>
> I am quite sure you are right about this, just from looking at the code.
> But I do want to check - the method is from ar 1998, so it has been in all
> the VMs for a very long time. How did you find the problem? Is there a
> test or an example that shows the issue?
>
> After fixing the method as you suggest, it will test for integer values
> with bit values in the range 11000000000000000000000000000000 through
> 00111111111111111111111111111111, which presumably maps to a range of
> acceptable values for use in the Matrix2x3Plugin floating point operations.
> So that looks quite reasonable, but I am puzzled that this check has been
> wrong since 1998, so that is why I ask.
>
I closed issue 7265. Eliot added your fix to Spur/Cog I did likewise for
VMM trunk (interpreter VM).
Dave
More information about the Vm-dev
mailing list