diff options
author | Greg Clayton <gclayton@fb.com> | 2024-02-22 10:25:05 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-22 10:25:05 -0800 |
commit | a23d4ceb8866df91334750627827a1724363e755 (patch) | |
tree | 5dc41194e8c66cabea2bbc8dfb84a72962475a8e /llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp | |
parent | 2e7cacfced573283d5424830f20333e2a6731251 (diff) | |
download | llvm-a23d4ceb8866df91334750627827a1724363e755.zip llvm-a23d4ceb8866df91334750627827a1724363e755.tar.gz llvm-a23d4ceb8866df91334750627827a1724363e755.tar.bz2 |
[lldb][llvm] Return an error instead of crashing when parsing a line table prologue. (#80769)
We recently ran into some bad DWARF where the `DW_AT_stmt_list` of many
compile units was randomly set to invalid values and was causing LLDB to
crash due to an assertion about address sizes not matching. Instead of
asserting, we should return an appropriate recoverable `llvm::Error`.
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp')
-rw-r--r-- | llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp index d42a626..980b627 100644 --- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp @@ -823,7 +823,9 @@ TEST_F(DebugLineBasicFixture, ErrorForUnsupportedAddressSizeDefinedInHeader) { nullptr, RecordRecoverable); EXPECT_THAT_ERROR( std::move(Recoverable), - FailedWithMessage("address size 0x09 of DW_LNE_set_address opcode at " + FailedWithMessage("parsing line table prologue at offset 0x00000000: " + "invalid address size 9", + "address size 0x09 of DW_LNE_set_address opcode at " "offset 0x00000038 is unsupported")); ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded()); ASSERT_EQ((*ExpectedLineTable)->Rows.size(), 3u); |