This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bug: extra four bytes between super/sub instance images, CNI not aware



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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]