X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=libjava%2Fexception.cc;h=088d48268e3da54e7749bce020f9e95379e11f2d;hb=95253e162ccc3d4b4325fd46de84665ffffee2c4;hp=917d6e10a76e502dfb40bd2e48b24fa6fd250f2f;hpb=842c788d0a4f99dd1e5e1d28d26928247bf32dc4;p=pf3gnuchains%2Fgcc-fork.git diff --git a/libjava/exception.cc b/libjava/exception.cc index 917d6e10a76..088d48268e3 100644 --- a/libjava/exception.cc +++ b/libjava/exception.cc @@ -15,6 +15,9 @@ details. */ #include #include +#include +#include +#include #include #include @@ -158,7 +161,7 @@ parse_lsda_header (_Unwind_Context *context, const unsigned char *p, return p; } -static jclass +static void ** get_ttype_entry (_Unwind_Context *context, lsda_header_info *info, long i) { _Unwind_Ptr ptr; @@ -166,7 +169,7 @@ get_ttype_entry (_Unwind_Context *context, lsda_header_info *info, long i) i *= size_of_encoded_value (info->ttype_encoding); read_encoded_value (context, info->ttype_encoding, info->TType - i, &ptr); - return reinterpret_cast(ptr); + return reinterpret_cast(ptr); } @@ -333,12 +336,14 @@ PERSONALITY_FUNCTION (int version, { // Positive filter values are handlers. - jclass catch_type = get_ttype_entry (context, &info, ar_filter); + void **catch_word = get_ttype_entry (context, &info, ar_filter); + jclass catch_type = (jclass)*catch_word; - // The catch_type is either a (java::lang::Class*) or - // is one more than a (Utf8Const*). - if ((size_t)catch_type & 1) - catch_type = _Jv_FindClass ((Utf8Const*)catch_type - 1, NULL); + // FIXME: This line is a kludge to work around exception + // handlers written in C++, which don't yet use indirect + // dispatch. + if (catch_type == *(void **)&java::lang::Class::class$) + catch_type = (jclass)catch_word; if (_Jv_IsInstanceOf (xh->value, catch_type)) {