llvm.org GIT mirror llvm / 4138232
[AArch64] [Windows] Fix llvm-readobj -unwind output with many epilogs. The number of epilog scopes may not fit into a uint8_t. Fixes https://bugs.llvm.org/show_bug.cgi?id=40855 Differential Revision: https://reviews.llvm.org/D58693 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355135 91177308-0d34-0410-b5e6-96231b3b80d8 Eli Friedman 1 year, 7 months ago
2 changed file(s) with 27 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
381381 return ((Data[0] & 0x00400000) >> 22);
382382 }
383383
384 uint8_t EpilogueCount() const {
384 uint16_t EpilogueCount() const {
385385 if (HeaderWords(*this) == 1) {
386386 if (isAArch64)
387387 return (Data[0] & 0x07C00000) >> 22;
0 // REQUIRES: aarch64-registered-target
1 // RUN: llvm-mc -filetype=obj -triple aarch64-windows %s -o - \
2 // RUN: | not llvm-readobj -unwind - | FileCheck %s
3
4 // Older versions of LLVM had a bug where we would accidentally
5 // truncate the number of epilogue scopes to a uint8_t; make
6 // sure this doesn't happen.
7 //
8 // We expect the llvm-readobj invocation to fail because the
9 // xdata section is truncated (to reduce the size of the testcase).
10
11 // CHECK: EpilogueScopes: 256
12
13 .section .pdata,"dr"
14 .long "?func@@YAHXZ"@IMGREL
15 .long "$unwind$func@@YAHXZ"@IMGREL
16
17 .text
18 .globl "?func@@YAHXZ"
19 .p2align 3
20 "?func@@YAHXZ":
21 ret
22
23 .section .xdata,"dr"
24 "$unwind$func@@YAHXZ":
25 .long 0x00000000, 0x02010100, 0x09000000, 0x0A000000