[Lldb-commits] [PATCH] D131244: [LLDB] Missing break in a switch statement alters the execution flow.
Slava Gurevich via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 5 00:44:31 PDT 2022
fixathon added a comment.
Added in-code comments with details
================
Comment at: lldb/source/Plugins/Process/Utility/ARMUtils.h:48-49
}
shift_t = SRType_Invalid;
return UINT32_MAX;
}
----------------
These lines were unreachable prior to the fix due to the **default** label with no break skipping to case 0. Past code history suggests that was accidental.
================
Comment at: lldb/source/Plugins/Process/Utility/ARMUtils.h:314-315
switch (bits(imm12, 9, 8)) {
default: // Keep static analyzer happy with a default case
+ break;
+
----------------
Same here. Past code history suggests the break was missing by accident, i.e the **default** case was added to satisfy a static code checker without the intent to modify the execution flow.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131244/new/
https://reviews.llvm.org/D131244
More information about the lldb-commits
mailing list