mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
edfe277b34
I've noticed an issue with "Data.getRelocatedValue(...)" call. it might silently ignore an error when a content is truncated. That leads to an infinite loop in the code (e.g. llvm-readobj hangs). After fixing the issue I've found that actually we always tried to read past the end of a section, even when a content was valid. It happened because the terminator CIE (a CIE with the length == 0) was never handled. At first I've tried just to stop adding the terminator entry (and return), but it does not seem to be correct, because tools like llvm-objdump might want to print something for such entries (see comments in the code and test cases). This patch fixes issues mentioned, provides new test cases for both llvm-readobj and lib/DebugInfo and adds FIXMEs to existent test cases related. Differential revision: https://reviews.llvm.org/D80299
11 lines
316 B
ArmAsm
11 lines
316 B
ArmAsm
## Check we report a proper error when the content
|
|
## of the .eh_frame section is truncated.
|
|
|
|
# RUN: llvm-mc -triple x86_64 %s -filetype=obj -o %t
|
|
# RUN: not llvm-dwarfdump -debug-frame %t 2>&1 | FileCheck %s
|
|
|
|
# CHECK: error: unexpected end of data at offset 0x4
|
|
|
|
.section .eh_frame,"a",@unwind
|
|
.long 0xFF ## Length
|