Bug in Float.valueOf(String)

Maxim Kizub max at immsp.kiev.ua
Tue Jan 26 15:09:44 PST 1999


Alexandre Oliva wrote:
> 
> On Jan 25, 1999, Archie Cobbs <archie at whistle.com> wrote:
> 
> > Maxim Kizub writes:
> >> Another way is to change in kaffe/kaffevm/support.c in
> >> method callMethodV :
> >>
> >> case 'F':
> >> call.callsize[i] = 1;
> >> in[i].f = va_arg(args, jfloat);
> >> break;
> >>
> >> into
> >>
> >> case 'F':
> >> call.callsize[i] = 1;
> >> in[i].f = (jfloat)va_arg(args, jdouble);
> >> break;
> 
> > Duh.. of course, that's a much more correct solution.
> 
> That was not enough when I first found the problem: when a native
> method was called, a float would be pushed onto the stack, but then
> the native code compiled by gcc would try to load a double (or so it
> seemed to me).  I'm not 100% sure about it right now, though, I have
> noticed that quite a long time ago, and worked around the problem in
> another way.  Maybe I'll have time to revisit this issue next week.

I think, the problem occures for elipses only?
Java do not invokes native methods with
variable number of arguments, this should not
be a problem, IMHO.

Regards
  Maxim Kizub


More information about the kaffe mailing list