MaskRay added a comment.
I think improving diagnostic is useful but `-fsanitize=` is probably not a good
place. Instrumenting call sites with `callq
__ubsan_handle_exception_escape@PLT` wastes code size. The functionality is
better handled somewhere in libc++abi personality related code with possible
improvement to exception handling related LLVM IR.
void bar(); void foo() { bar(); }
`clang++ -fno-exceptions -fsanitize=exception-escape -c b.cc` does not
instrument the potentially-throwing-and-propagating `bar()` so an error cannot
be caught.
However, for `-fno-exceptions` code, instrumenting every call site is going to
greatly increase code size and suppress optimizations.
I wish that I capture the compiler and runtime behavior well in
https://maskray.me/blog/2020-12-12-c++-exception-handling-abi#compiler-behavior.
https://discourse.llvm.org/t/catching-exceptions-while-unwinding-through-fno-exceptions-code/57151
is a proposal to improve the diagnostics.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137381/new/
https://reviews.llvm.org/D137381
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits