This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

java/6754: Casting to gnu.gcj.RawData causes SEGV



>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:


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