[PATCH] D86527: [3/5] [MC] [Win64EH] Produce well-formed xdata records when info is missing

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 01:37:45 PDT 2020


mstorsjo added a comment.

In D86527#2237241 <https://reviews.llvm.org/D86527#2237241>, @efriedma wrote:

> If there aren't any unwind codes, the compiler should completely skip emitting the .pdata record.  That's what the spec suggests the compiler should do, and probably matches what tooling expects.  So I think if we do end up with SEH directives without any SEH opcodes, we should either omit the .pdata record, or reject the assembly.

Fair enough. In most cases it's straightforward to do that, but there's one main exception. There's a `.seh_handlerdata` directive, and on that, it triggers emission of the xdata record right away. And when emitting the xdata record, the FrameInfo gets cleared of the opcodes, so it's not entirely evident at that point whether the xdata already emitted was bogus or not.

Or I guess one possible solution to that would be to add another flag to FrameInfo after the xdata was written, indicating whether it was sensible or not. (Or just clear the `info->Symbol` member to pretend that it wasn't ever emitted, even if there's a few orphaned bytes in the xdata section?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86527



More information about the llvm-commits mailing list