1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/DebugInfo/X86/dwarfdump-rnglists-zero-length.s
Igor Kudrin 307bae0402 [DebugInfo] Fix a possible crash when reading a malformed .debug_*lists section.
DWARFListTableHeader::length() handles the zero value of HeaderData.Length
in a special way, which makes the result different from the calculated
value of FullLength, which leads to triggering an assertion. The patch
moves the assertion a bit later when `FullLength` is already checked for
minimal allowed value.

Differential Revision: https://reviews.llvm.org/D82886
2020-07-14 16:35:17 +07:00

13 lines
517 B
ArmAsm

## The test checks that llvm-dwarfdump can handle a malformed input file without
## crashing.
# RUN: llvm-mc -triple x86_64 %s -filetype=obj -o %t
# RUN: not llvm-dwarfdump -debug-rnglists %t 2>&1 | FileCheck %s
# CHECK: error: .debug_rnglists table at offset 0x0 has too small length (0x4) to contain a complete header
## An assertion used to trigger in the debug build of the DebugInfo/DWARF
## library if the unit length field in a range list table was 0.
.section .debug_rnglists,"",@progbits
.long 0