[PATCH] D13767: [X86] Fix more -Os + EH issues

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 11:23:50 PDT 2015


rnk added a comment.

In http://reviews.llvm.org/D13767#272094, @mkuper wrote:

> In particular, gnu_args_size is now only generated for fp-based CFA. Frederic, does that sounds right to you?


Hm, I think there might be an issue here. The cfa_adjust directives don't instruct the unwinder to adjust ESP before transferring to the landingpad, right? They just help indicate where the return address lives in memory.

The test case for this situation is something like:

  int main() {
    // force stack realignment, FP usage, and use of SP to address local variables
    int __attribute__((align(32))) x = 42;
    try {
      throw 1;
    } catch (int) {
      return x;
    }
  }

If ESP is wrong in the landingpad, we'll return the wrong value of x.


http://reviews.llvm.org/D13767





More information about the llvm-commits mailing list