https://github.com/xgupta updated 
https://github.com/llvm/llvm-project/pull/94841

>From 5451d769f36528e9640e665d4124103a6c34bf20 Mon Sep 17 00:00:00 2001
From: Shivam Gupta <shivam98....@gmail.com>
Date: Sat, 8 Jun 2024 11:14:06 +0530
Subject: [PATCH 1/2] [lldb] Fix redundant condition in compression type check
 (NFC)

The `else if` condition for checking `m_compression_type` is redundant as it 
matches with a previous `if` condition, making the expression always false.
Reported by cppcheck as a possible cut-and-paste error.

Caught by cppcheck -
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp:543:35: 
style: Expression is always false because 'else if' condition matches previous 
condition at line 535. [multiCondition]

Fix #91222
---
 .../Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp       | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 8a47eed3d7cbe..52bf8533bbd8a 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -540,8 +540,6 @@ bool GDBRemoteCommunication::DecompressPacket() {
         scratchbuf_size = compression_decode_scratch_buffer_size 
(COMPRESSION_ZLIB);
       else if (m_compression_type == CompressionType::LZMA)
         scratchbuf_size = compression_decode_scratch_buffer_size 
(COMPRESSION_LZMA);
-      else if (m_compression_type == CompressionType::LZFSE)
-        scratchbuf_size = compression_decode_scratch_buffer_size 
(COMPRESSION_LZFSE);
       if (scratchbuf_size > 0) {
         m_decompression_scratch = (void*) malloc (scratchbuf_size);
         m_decompression_scratch_type = m_compression_type;

>From dd6b3b57a509088565cb7df178fd3e9d55c7e55e Mon Sep 17 00:00:00 2001
From: Shivam Gupta <shivam98....@gmail.com>
Date: Sat, 8 Jun 2024 11:24:58 +0530
Subject: [PATCH 2/2] clang format

---
 .../Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 52bf8533bbd8a..187370eb36cae 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -539,7 +539,8 @@ bool GDBRemoteCommunication::DecompressPacket() {
       else if (m_compression_type == CompressionType::ZlibDeflate)
         scratchbuf_size = compression_decode_scratch_buffer_size 
(COMPRESSION_ZLIB);
       else if (m_compression_type == CompressionType::LZMA)
-        scratchbuf_size = compression_decode_scratch_buffer_size 
(COMPRESSION_LZMA);
+        scratchbuf_size =
+            compression_decode_scratch_buffer_size(COMPRESSION_LZMA);
       if (scratchbuf_size > 0) {
         m_decompression_scratch = (void*) malloc (scratchbuf_size);
         m_decompression_scratch_type = m_compression_type;

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to