[PATCH] D143637: StackProtector: add unwind cleanup paths for instrumentation.

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 01:40:59 PST 2023


t.p.northover added inline comments.


================
Comment at: llvm/lib/CodeGen/DwarfEHPrepare.cpp:297
 bool DwarfEHPrepare::InsertUnwindResumeCalls() {
+  if (F.hasPersonalityFn() &&
+      StackProtector::requiresStackProtector(&F, nullptr))
----------------
xiangzhangllvm wrote:
> I just header the func __gxx_personality_v0  in **libc++** will handle the exception. 
> Does all the callees in the caller (with personality attribute) may do invisible unwinds for exception ? So you visibly generate the cleanup resume (to let current stack protect can see it then generate protection code. )
That's pretty much it. 

Actually, even without a personality function callees might unwind through this function (that just needs `uwtables` or similar) but without a personality function we have no way to intercept the exception and check the stack is OK on the way back through.


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

https://reviews.llvm.org/D143637



More information about the llvm-commits mailing list