bug: extra four bytes between super/sub instance images, CNI not aware
Bryce McKinlay
bryce@waitaki.otago.ac.nz
Sun Apr 21 07:21:00 GMT 2002
Tom Tromey wrote:
>>>>>>"Bryce" == Bryce McKinlay <bryce@waitaki.otago.ac.nz> writes:
>>>>>>>>Adam> Can somebody confirm that this is a bug? The program below
>Adam> prints out "0" rather than "3". Closer inspection reveals that
>Adam> foo() is looking at a memory location four bytes less than wher
>Adam> y is. This behavior occurs on both Win32 and Linux.
>>Bryce> I get this too. Is this a regression?
>>I don't know if it is or not. I want to understand why I don't see
>the problem.
>
I get it with yesterdays mainline on PowerPC. I haven't tried with 3.1
or on x86 yet.
>Adam, why are you using -fno-rtti? Bryce, does removing it affect
>your results? (It doesn't for me.)
>
No, it makes no difference.
>Do the generated .h files look correct? Mine do.
>
Yes, they look correct. What seems to be happening is that C++ is
reading the field "y" at the correct offset by my calculation (20) but
GCJ is giving "inner" 64-bit alignment within "sup" and thus accessing
it at the wrong offset (24). Removing the "long" field from sup corrects
it, so the presence of the long is confusing gcj somehow.
I was suspicious that this might have been caused by my recent alignment
patch, but reverting that made no difference.
regards
Bryce.
More information about the Java
mailing list