[libcxx-commits] [PATCH] D93190: [libc++abi] Simplify scan_eh_tab

Fangrui Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 11 16:27:16 PST 2021


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: libcxxabi/src/cxa_personality.cpp:738
-                        }
-                        else if (!(actions & _UA_FORCE_UNWIND))
-                        {
----------------
For regular unwinding: if the search phase returns `_URC_HANDLER_FOUND` (`catch (...)` always matches), the cleanup phase will get `_UA_HANDLER_FRAME` and will match as well. The check here is dead.

For `_UA_FORCE_UNWIND`, there is no search phase. The code path is skipped.


================
Comment at: libcxxabi/src/cxa_personality.cpp:776-778
-                                // It looks like the exception table has changed
-                                //    on us.  Likely stack corruption!
-                                call_terminate(native_exception, unwind_exception);
----------------
ldionne wrote:
> I don't understand why we're allowed to remove this. Can you please explain? The same question applies to other removals of `call_terminate` below.
For regular unwinding: if the search phase returns `_URC_HANDLER_FOUND` (`can_catch` returns true), the cleanup phase will match as well. These are some additional sanity checks but they are not useful and just clutter up the code. Neither libsupc++ nor libcxxrt has the additional checks.

For `_UA_FORCE_UNWIND`, there is no search phase. The code path is skipped.


================
Comment at: libcxxabi/src/cxa_personality.cpp:808
-                            // If this is a type 3 search _UA_FORCE_UNWIND, ignore handler and continue scan
-                            if (actions & _UA_SEARCH_PHASE)
-                            {
----------------
For regular unwinding: if the search phase returns `_URC_HANDLER_FOUND` (the exception specifier cannot match the propagated exception), the cleanup phase will have `exception_spec_can_catch` returning true as well. The check here is dead.

For `_UA_FORCE_UNWIND`, there is no search phase. The code path is skipped.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93190/new/

https://reviews.llvm.org/D93190



More information about the libcxx-commits mailing list