[Lldb-commits] [lldb] [lldb] Guard DW_OP_convert against null DWARF unit and empty stack (PR #207008)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 2 04:58:33 PDT 2026


================
@@ -574,6 +574,20 @@ TEST(DWARFExpression, DW_OP_convert) {
   EXPECT_THAT_ERROR(
       t.Eval({DW_OP_const1s, 'X', DW_OP_convert, 0x1d}).takeError(),
       llvm::Failed());
+
+  // A non-zero DIE offset with no DWARF unit must report an error rather than
+  // dereferencing a null Delegate (caught by lldb-dwarf-expression-fuzzer).
+  EXPECT_THAT_ERROR(
+      Evaluate({DW_OP_const1s, 'X', DW_OP_convert, 0x01}, nullptr, nullptr)
+          .takeError(),
+      llvm::Failed());
+
+  // DW_OP_convert with an empty stack must report an error rather than
+  // accessing the back of an empty stack (caught by
+  // lldb-dwarf-expression-fuzzer).
+  EXPECT_THAT_ERROR(
+      Evaluate({DW_OP_convert, 0x00}, nullptr, nullptr).takeError(),
+      llvm::Failed());
----------------
Michael137 wrote:

Same comment re. `FailedWithMessage` as above

https://github.com/llvm/llvm-project/pull/207008


More information about the lldb-commits mailing list