diff options
author | Andrew Haley <aph@cygnus.com> | 2000-02-10 17:16:30 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2000-02-10 17:16:30 +0000 |
commit | 715bdd81177d2e691d07c19c1a4e48d63474ed81 (patch) | |
tree | 050f8341578bf95abc8c7ab48b6e79fd2b1e77ac /libjava/resolve.cc | |
parent | ae0a06c54bdf4fa7511c4b65315a05a684ca7c03 (diff) | |
download | gcc-715bdd81177d2e691d07c19c1a4e48d63474ed81.zip gcc-715bdd81177d2e691d07c19c1a4e48d63474ed81.tar.gz gcc-715bdd81177d2e691d07c19c1a4e48d63474ed81.tar.bz2 |
interpret.cc: Don't include fdlibm.h.
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.
From-SVN: r31897
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 eb9a371..0d39de1 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++) |