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

Simon Tatham via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 8 05:07:52 PST 2023


================
@@ -1471,6 +1471,11 @@ void LowerTypeTestsModule::createJumpTable(
   SmallVector<Value *, 16> AsmArgs;
   AsmArgs.reserve(Functions.size() * 2);
 
+  // Check if the first entry has the NoUnwind attribute.
----------------
statham-arm wrote:

I don't understand why the first entry is treated specially.

I'd have expected that if _any_ function in the dispatch table might throw an exception through it, then the dispatch table would need unwind info. So I'd expect to see something more like "if _all_ functions have NoUnwind then give the dispatch table NoUnwind as well". Why just the first?

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


More information about the llvm-commits mailing list