Skip to content

[lldb] remove a superfluous assignment statement #152669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2025

Conversation

sedymrak
Copy link
Contributor

@sedymrak sedymrak commented Aug 8, 2025

cfa_reg_contents is a local variable. Whatever value we assign there right before the return statement will be lost anyway.

@sedymrak sedymrak requested a review from JDevlieghere as a code owner August 8, 2025 09:00
@llvmbot llvmbot added the lldb label Aug 8, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 8, 2025

@llvm/pr-subscribers-lldb

Author: None (sedymrak)

Changes

cfa_reg_contents is a local variable. Whatever value we assign there right before the return statement will be lost anyway.


Full diff: https://github.com/llvm/llvm-project/pull/152669.diff

1 Files Affected:

  • (modified) lldb/source/Target/RegisterContextUnwind.cpp (-1)
diff --git a/lldb/source/Target/RegisterContextUnwind.cpp b/lldb/source/Target/RegisterContextUnwind.cpp
index 9e9e2d86958f3..bcf1297f2114f 100644
--- a/lldb/source/Target/RegisterContextUnwind.cpp
+++ b/lldb/source/Target/RegisterContextUnwind.cpp
@@ -2026,7 +2026,6 @@ bool RegisterContextUnwind::ReadFrameAddress(
             "Got an invalid CFA register value - reg %s (%d), value 0x%" PRIx64,
             cfa_reg.GetName(), cfa_reg.GetAsKind(eRegisterKindLLDB),
             cfa_reg_contents);
-        cfa_reg_contents = LLDB_INVALID_ADDRESS;
         return false;
       }
       address = cfa_reg_contents + fa.GetOffset();

@DavidSpickett DavidSpickett changed the title remove a superfluous assignment statement [lldb] remove a superfluous assignment statement Aug 8, 2025
@JDevlieghere JDevlieghere merged commit ee56cb9 into llvm:main Aug 12, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants