Skip to content

Commit

Permalink
[DWARF] Fix arity of DW_OP_bra (#114136)
Browse files Browse the repository at this point in the history
Found by my proof-of-concept DWARF expression evaluator fuzzer.
  • Loading branch information
JDevlieghere authored Oct 29, 2024
1 parent 0f8dbb2 commit 75b37c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lldb/unittests/Expression/DWARFExpressionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ TEST(DWARFExpression, DW_OP_bra) {
}),
// clang-format on
llvm::HasValue(0x42));

EXPECT_THAT_ERROR(Evaluate({DW_OP_bra, 0x01, 0x00}).takeError(),
llvm::Failed());
}

TEST(DWARFExpression, DW_OP_convert) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/BinaryFormat/Dwarf.def
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ HANDLE_DW_OP(0x24, shl, 0, 2, 2, DWARF)
HANDLE_DW_OP(0x25, shr, 0, 2, 2, DWARF)
HANDLE_DW_OP(0x26, shra, 0, 2, 2, DWARF)
HANDLE_DW_OP(0x27, xor, 0, 2, 2, DWARF)
HANDLE_DW_OP(0x28, bra, 1, 0, 2, DWARF)
HANDLE_DW_OP(0x28, bra, 1, 1, 2, DWARF)
HANDLE_DW_OP(0x29, eq, 0, 2, 2, DWARF)
HANDLE_DW_OP(0x2a, ge, 0, 2, 2, DWARF)
HANDLE_DW_OP(0x2b, gt, 0, 2, 2, DWARF)
Expand Down

0 comments on commit 75b37c3

Please sign in to comment.