efriedma added inline comments.

================
Comment at: lib/CodeGen/CGCall.cpp:2756
                                          SourceLocation EndLoc) {
+  if (FI.isNoReturn()) {
+    // Noreturn functions don't return.
----------------
Unfortunately, this won't catch cases where the caller has a noreturn marking, 
but the callee doesn't.  Maybe strip the noreturn attribute from the caller, 
then put the sanitizer check into both the caller and callee?


================
Comment at: lib/CodeGen/CGCall.cpp:2764
     // Naked functions don't have epilogues.
-    Builder.CreateUnreachable();
+    EmitUnreachable(EndLoc);
     return;
----------------
This is likely a problem.  Not because the code is supposed to be reachable, 
but because putting additional code into a naked function can have weird 
effects.  Probably not worth messing with this case.


https://reviews.llvm.org/D40698



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to