forked from OSchip/llvm-project
[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
This commit is contained in:
parent
436f7b6d8a
commit
ab296670e1
|
@ -487,8 +487,8 @@ static void ARM64EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) {
|
||||||
|
|
||||||
// Code Words, Epilog count, E, X, Vers, Function Length
|
// Code Words, Epilog count, E, X, Vers, Function Length
|
||||||
uint32_t row1 = 0x0;
|
uint32_t row1 = 0x0;
|
||||||
uint8_t CodeWords = TotalCodeBytes / 4;
|
uint32_t CodeWords = TotalCodeBytes / 4;
|
||||||
uint8_t CodeWordsMod = TotalCodeBytes % 4;
|
uint32_t CodeWordsMod = TotalCodeBytes % 4;
|
||||||
if (CodeWordsMod)
|
if (CodeWordsMod)
|
||||||
CodeWords++;
|
CodeWords++;
|
||||||
uint32_t EpilogCount = info->EpilogMap.size();
|
uint32_t EpilogCount = info->EpilogMap.size();
|
||||||
|
@ -505,6 +505,11 @@ static void ARM64EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) {
|
||||||
|
|
||||||
// Extended Code Words, Extended Epilog Count
|
// Extended Code Words, Extended Epilog Count
|
||||||
if (ExtensionWord) {
|
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;
|
uint32_t row2 = 0x0;
|
||||||
row2 |= (CodeWords & 0xFF) << 16;
|
row2 |= (CodeWords & 0xFF) << 16;
|
||||||
row2 |= (EpilogCount & 0xFFFF);
|
row2 |= (EpilogCount & 0xFFFF);
|
||||||
|
|
Loading…
Reference in New Issue