Skip to content

Commit ef01c75

Browse files
authored
[lldb] Remove dead code block (NFC) (#94775)
The check that max_bit_pos == sign_bit_pos conflicts with the check that sign_bit_pos < max_bit_pos in the block surrounding it. Originally found by cppcheck - lldb/source/Utility/Scalar.cpp:756:23: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition] Fixes #85985
1 parent e48f211 commit ef01c75

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lldb/source/Utility/Scalar.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -753,9 +753,7 @@ bool Scalar::SignExtend(uint32_t sign_bit_pos) {
753753
return false;
754754

755755
case Scalar::e_int:
756-
if (max_bit_pos == sign_bit_pos)
757-
return true;
758-
else if (sign_bit_pos < (max_bit_pos - 1)) {
756+
if (sign_bit_pos < (max_bit_pos - 1)) {
759757
llvm::APInt sign_bit = llvm::APInt::getSignMask(sign_bit_pos + 1);
760758
llvm::APInt bitwize_and = m_integer & sign_bit;
761759
if (bitwize_and.getBoolValue()) {

0 commit comments

Comments
 (0)