[Lldb-commits] [lldb] 50b0c34 - [lldb] Fix assertion when opcodes are exactly the length of the buffer (#157196)

via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 8 10:37:03 PDT 2025


Author: Daniel Sanders
Date: 2025-09-08T10:37:00-07:00
New Revision: 50b0c34dfb3140f3fce08e0435973780617f8966

URL: https://github.com/llvm/llvm-project/commit/50b0c34dfb3140f3fce08e0435973780617f8966
DIFF: https://github.com/llvm/llvm-project/commit/50b0c34dfb3140f3fce08e0435973780617f8966.diff

LOG: [lldb] Fix assertion when opcodes are exactly the length of the buffer (#157196)

Added: 
    

Modified: 
    lldb/include/lldb/Core/Opcode.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Core/Opcode.h b/lldb/include/lldb/Core/Opcode.h
index f680e0b91ab85..7bbd73d039f99 100644
--- a/lldb/include/lldb/Core/Opcode.h
+++ b/lldb/include/lldb/Core/Opcode.h
@@ -211,7 +211,7 @@ class Opcode {
     if (bytes != nullptr && length > 0) {
       m_type = type;
       m_data.inst.length = length;
-      assert(length < sizeof(m_data.inst.bytes));
+      assert(length <= sizeof(m_data.inst.bytes));
       memcpy(m_data.inst.bytes, bytes, length);
       m_byte_order = order;
     } else {


        


More information about the lldb-commits mailing list