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

Saleem Abdulrasool via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 20 16:26:05 PST 2021


compnerd added a comment.

I like the clean up here, but, I think there is some value in retaining the defensive sanity checks.  You are correct that in most cases, this should never be hit in a proper unwind, but because this may be run in a last chance scenario, having the defensive checks is good for catching things going wrong.



================
Comment at: libcxxabi/src/cxa_personality.cpp:738
-                        }
-                        else if (!(actions & _UA_FORCE_UNWIND))
-                        {
----------------
MaskRay wrote:
> 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.
Correct, this was a sanity check path.  I think that rewriting it as an explicit check and terminate (which is annotated as being cold even) would be nice to retain.  At the very least, we should assert that.


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