[llvm] [CFI] Fix Direct Call Issues in CFI Dispatch Table (PR #69663)

Oskar Wirga via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 09:08:35 PST 2023


oskarwirga wrote:

> I'm happy with this version of the code, assuming that what we're trying to achieve is sensible. But I'm curious about @efriedma-quic 's point about tail calls. Why do we ever need EH info on a jump table at all, since it doesn't leave a trace on the call stack that needs to be unwound through?
> 
> Can you add a bit more detail to the commit message explaining what specifically goes wrong if you leave the jump table as NoUnwind?

Yes absolutely! The issue is that if a jump table has a single entry, it can be inlined as a direct call. If this direct call has the NoUnwind attribute, the containing function of the indirect function call will drop all exception handling code, even if the indirect function that is dispatched to throws.

https://github.com/llvm/llvm-project/pull/69663


More information about the llvm-commits mailing list