diff options
author | Eli Friedman <efriedma@codeaurora.org> | 2018-11-08 21:20:52 +0000 |
---|---|---|
committer | Eli Friedman <efriedma@codeaurora.org> | 2018-11-08 21:20:52 +0000 |
commit | ab296670e1b0da1554f5a859558d00777921232f (patch) | |
tree | d001570c50d699fa60baa611f0a158a837aa8288 | |
parent | 436f7b6d8a38be0d6f69754117fecf8f52c2cab7 (diff) | |
download | bcm5719-llvm-ab296670e1b0da1554f5a859558d00777921232f.tar.gz bcm5719-llvm-ab296670e1b0da1554f5a859558d00777921232f.zip |
[ARM64] [Windows] Improve error reporting for unsupported SEH unwind.
Use report_fatal_error instead of crashing or miscompiling. (It's
currently easier than it should be to hit this case because we don't
reuse codes across epilogs.)
llvm-svn: 346440
-rw-r--r-- | llvm/lib/MC/MCWin64EH.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCWin64EH.cpp b/llvm/lib/MC/MCWin64EH.cpp index 0c8d58e5972..5268d2752d8 100644 --- a/llvm/lib/MC/MCWin64EH.cpp +++ b/llvm/lib/MC/MCWin64EH.cpp @@ -487,8 +487,8 @@ static void ARM64EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) { // Code Words, Epilog count, E, X, Vers, Function Length uint32_t row1 = 0x0; - uint8_t CodeWords = TotalCodeBytes / 4; - uint8_t CodeWordsMod = TotalCodeBytes % 4; + uint32_t CodeWords = TotalCodeBytes / 4; + uint32_t CodeWordsMod = TotalCodeBytes % 4; if (CodeWordsMod) CodeWords++; uint32_t EpilogCount = info->EpilogMap.size(); @@ -505,6 +505,11 @@ static void ARM64EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) { // Extended Code Words, Extended Epilog Count if (ExtensionWord) { + // FIXME: We should be able to split unwind info into multiple sections. + // FIXME: We should share epilog codes across epilogs, where possible, + // which would make this issue show up less frequently. + if (CodeWords > 0xFF || EpilogCount > 0xFFFF) + report_fatal_error("SEH unwind data splitting not yet implemented"); uint32_t row2 = 0x0; row2 |= (CodeWords & 0xFF) << 16; row2 |= (EpilogCount & 0xFFFF); |