diff --git a/eh_personality.c b/eh_personality.c index 81c4420..0b97340 100644 --- a/eh_personality.c +++ b/eh_personality.c @@ -157,11 +157,15 @@ static handler_type check_action_record(struct _Unwind_Context *context, return handler_catchall_id; } } - else if (isKindOfClass(thrown_class, type)) + else if (!foreignException && isKindOfClass(thrown_class, type)) { fprintf(stderr, "found handler for %s\n", type->name); return handler_class; } + else if (thrown_class == type) + { + return handler_class; + } } else if (filter == 0) {