[PATCH] D77767: Prevent stack coloring functions whith setjmp / longjmp

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 19:01:18 PDT 2020


efriedma added a comment.

I'm not sure I understand the problem; can you give a C testcase?

In general, stack coloring should be okay, as long as we aren't truncating the lifetime of a variable.  If a variable which is live at the point setjmp is called is still live at the point of the longjmp, it shouldn't overlap with anything relevant.  If the variable isn't live at the point of the longjmp, we don't have any obligation to preserve the value according to the standard (from C99: "All accessible objects have values [...]").

If we truncate the lifetime of a variable, that could be a problem: a variable which the standard requires to be live would be dead, and potentially overlap with something relevant.  But I'm not sure how that would happen in practice if we still have an alloca going into isel.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77767





More information about the llvm-commits mailing list