[Lldb-commits] [lldb] [lldb][nfc] Fix incorrect union usage in UnwindAssemblyInstEmulation (PR #168341)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Nov 17 02:39:46 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Felipe de Azevedo Piovezan (felipepiovezan)
<details>
<summary>Changes</summary>
This is harmless due to the previous checks for > 0, but it is still confusing for the readers.
---
Full diff: https://github.com/llvm/llvm-project/pull/168341.diff
1 Files Affected:
- (modified) lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp (+3-3)
``````````diff
diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
index 790f230af74c9..9c0b2998c37e5 100644
--- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -505,12 +505,12 @@ bool UnwindAssemblyInstEmulation::WriteRegister(
case EmulateInstruction::eContextRelativeBranchImmediate: {
if (context.GetInfoType() == EmulateInstruction::eInfoTypeISAAndImmediate &&
context.info.ISAAndImmediate.unsigned_data32 > 0) {
- m_forward_branch_offset =
- context.info.ISAAndImmediateSigned.signed_data32;
+ m_forward_branch_offset = context.info.ISAAndImmediate.unsigned_data32;
} else if (context.GetInfoType() ==
EmulateInstruction::eInfoTypeISAAndImmediateSigned &&
context.info.ISAAndImmediateSigned.signed_data32 > 0) {
- m_forward_branch_offset = context.info.ISAAndImmediate.unsigned_data32;
+ m_forward_branch_offset =
+ context.info.ISAAndImmediateSigned.signed_data32;
} else if (context.GetInfoType() ==
EmulateInstruction::eInfoTypeImmediate &&
context.info.unsigned_immediate > 0) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/168341
More information about the lldb-commits
mailing list