This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
bug: extra four bytes between super/sub instance images, CNI not aware
- From: Adam Megacz <gcj at lists dot megacz dot com>
- To: java at gcc dot gnu dot org
- Date: 19 Apr 2002 18:01:24 -0700
- Subject: bug: extra four bytes between super/sub instance images, CNI not aware
- Organization: Myself
Can somebody confirm that this is a bug? The program below prints out
"0" rather than "3". Closer inspection reveals that foo() is looking
at a memory location four bytes less than wher y is. This behavior
occurs on both Win32 and Linux.
- a
cat > test.java <<\EOF
abstract class sup {
long a;
boolean b;
public sup() { }
}
public class test {
public static void main(String[] s) { new inner(); }
static class inner extends sup {
int y = 3;
native void foo();
inner() { foo(); }
}
}
EOF
cat > test.cc <<\EOF
#include "test$inner.h"
#include "java/lang/System.h"
#include "java/io/PrintStream.h"
void test$inner::foo() {
java::lang::System::out->println(y);
}
EOF
jikes test.java
gcjh test\$inner
gcjh sup
CLASSPATH= gcj -I. test.cc test.java -fno-rtti --main=test
./a.out
--
The web is dead; long live the Internet.
http://www.xwt.org/