java/6754: Casting to gnu.gcj.RawData causes SEGV
adam@xwt.org
adam@xwt.org
Mon May 20 17:56:00 GMT 2002
>Number: 6754
>Category: java
>Synopsis: Casting to gnu.gcj.RawData causes SEGV
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon May 20 17:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: adam@xwt.org
>Release: unknown-1.0
>Organization:
>Environment:
GCJ (Linux and Win32 verified)
>Description:
Cast a gnu.gcj.RawData to Object and then back. When
casting back, the code will throw a NullPointerException --
I assume this is because the gcj-generated code is attempting
to follow the Class pointer (which RawData does not have).
>How-To-Repeat:
import java.io.*;
import gnu.gcj.RawData;
public class test {
public static native RawData foo();
public static RawData bar(Object o) {
return (RawData)o;
}
public static void main(String[] s) throws Exception {
bar(foo());
}
}
#include<gcj/cni.h>
#include<gnu/gcj/RawData.h>
#include "test.h"
gnu::gcj::RawData* test::foo() {
return (gnu::gcj::RawData*)73;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list