diff options
author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-02-10 17:16:30 +0000 |
---|---|---|
committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-02-10 17:16:30 +0000 |
commit | a13dc0d118a900441b76214132be5c401328eaa5 (patch) | |
tree | 050f8341578bf95abc8c7ab48b6e79fd2b1e77ac /libjava/resolve.cc | |
parent | d1a00ce0da5cfe000daef5e11f5ff8b0949ea69a (diff) | |
download | gcc-a13dc0d118a900441b76214132be5c401328eaa5.tar.gz |
2000-02-10 Andrew Haley <aph@cygnus.com>
* interpret.cc: Don't include fdlibm.h.
Replace #if with #ifdef throughout.
Declare extern __ieee754_fmod.
(continue1): Remove op_getfield, op_getstatic, op_putfield,
op_putstatic insns.
* resolve.cc (_Jv_PrepareClass): Use imeth as method pointer.
Search class hierarchy for superclass vtable.
* java/lang/natClassLoader.cc (_Jv_UnregisterClass): Don't fall
off the end of a pointer list.
* java/lang/natThread.cc (stop): Don't abort, throw an exception
instead.
(suspend): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31897 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/resolve.cc')
-rw-r--r-- | libjava/resolve.cc | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libjava/resolve.cc b/libjava/resolve.cc index eb9a37168b4..0d39de1ee6a 100644 --- a/libjava/resolve.cc +++ b/libjava/resolve.cc @@ -576,7 +576,7 @@ _Jv_PrepareClass(jclass klass) } else if (imeth != 0) // it could be abstract { - _Jv_InterpMethod *im = reinterpret_cast<_Jv_InterpMethod *> (im); + _Jv_InterpMethod *im = reinterpret_cast<_Jv_InterpMethod *> (imeth); clz->methods[i].ncode = im->ncode (); } } @@ -650,10 +650,20 @@ _Jv_PrepareClass(jclass klass) + (sizeof (void*) * (vtable_count))); vtable->clas = clz; - /* copy super class' vtable entries (index 0 goes unused). */ - memcpy ((void*)&vtable->method[1], - (void*)&super_class->vtable->method[1], - sizeof (void*) * super_class->vtable_method_count); + { + jclass effective_superclass = super_class; + + /* If super_class is abstract or an interface it has no vtable. + We need to find a real one... */ + while (effective_superclass && effective_superclass->vtable == NULL) + effective_superclass = effective_superclass->superclass; + + /* copy super class' vtable entries (index 0 goes unused). */ + if (effective_superclass && effective_superclass->vtable) + memcpy ((void*)&vtable->method[1], + (void*)&effective_superclass->vtable->method[1], + sizeof (void*) * effective_superclass->vtable_method_count); + } /* now, install our own vtable entries, reprise... */ for (int i = 0; i < clz->method_count; i++) |