[Lldb-commits] [lldb] [lldb] Don't build an opcode from a failed disassembly (PR #208279)

Charles Zablit via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 8 10:56:45 PDT 2026


https://github.com/charles-zablit created https://github.com/llvm/llvm-project/pull/208279

lldb does not check if the instruction was decoded correctly. This causes an assertion failure when starting lldb-dap on Windows with lldb-server.

Requires:
- https://github.com/llvm/llvm-project/pull/208277.

>From efa86ebdbba4960f663969c4004317a5001d64ec Mon Sep 17 00:00:00 2001
From: Charles Zablit <c_zablit at apple.com>
Date: Wed, 8 Jul 2026 18:53:21 +0100
Subject: [PATCH] [lldb] Don't build an opcode from a failed disassembly

---
 lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
index a18c95bdbde98..fe59e988e3cd9 100644
--- a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
+++ b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
@@ -530,7 +530,7 @@ class InstructionLLVMC : public lldb_private::Instruction {
           m_is_valid = mc_disasm_ptr->GetMCInst(opcode_data, opcode_data_len,
                                                 pc, inst, inst_size);
           m_opcode.Clear();
-          if (inst_size != 0) {
+          if (m_is_valid && inst_size != 0) {
             if (arch.GetTriple().isRISCV())
               m_opcode.SetOpcode16_32TupleBytes(opcode_data, inst_size,
                                                 byte_order);



More information about the lldb-commits mailing list