Bug in Float.valueOf(String)

Alexandre Oliva oliva at dcc.unicamp.br
Tue Jan 26 13:30:38 PST 1999


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.

-- 
Alexandre Oliva  http://www.dcc.unicamp.br/~oliva  aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Universidade Estadual de Campinas, SP, Brasil



More information about the kaffe mailing list