HomePhabricator

[AArch64][Windows] Compute function length correctly in unwind tables.
Audit Required9d09a223aa13

Authored by efriedma on May 2 2019, 5:10 PM.

Description

[AArch64][Windows] Compute function length correctly in unwind tables.

The primary fix here is to WinException.cpp: we need to exclude jump
tables when computing the length of a function, or else we fail to
correctly compute the length. (We can only compute the number of bytes
consumed by certain assembler directives after the entire file is
parsed. ".p2align" is one of those directives, and is used by jump table
generation.)

The secondary fix, to MCWin64EH, is to make sure we don't silently
miscompile if we hit a similar situation in the future.

It's possible we could extend ARM64EmitUnwindInfo so it allows function
bodies that contain assembler directives, but that's a lot more
complicated; see the FIXME in MCWin64EH.cpp.

Fixes https://bugs.llvm.org/show_bug.cgi?id=41581 .

Differential Revision: https://reviews.llvm.org/D61095

llvm-svn: 359849

Details

Auditors
grosbach
Committed
sidorovdMay 17 2019, 2:54 AM
Differential Revision
D61095: [AArch64][Windows] Compute function length correctly in unwind tables.
Parents
rG345f11924375: [Reproducers] Improve reproducer help
Branches
Unknown
Tags
Unknown