[Lldb-commits] [PATCH] D94917: [lldb] Fix crash in "help memory read"
David Spickett via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jan 19 01:54:27 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9a7672ac4980: [lldb] Fix crash in "help memory read" (authored by DavidSpickett).
Changed prior to commit:
https://reviews.llvm.org/D94917?vs=317364&id=317489#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94917/new/
https://reviews.llvm.org/D94917
Files:
lldb/include/lldb/Utility/OptionDefinition.h
lldb/test/API/commands/help/TestHelp.py
Index: lldb/test/API/commands/help/TestHelp.py
===================================================================
--- lldb/test/API/commands/help/TestHelp.py
+++ lldb/test/API/commands/help/TestHelp.py
@@ -56,6 +56,11 @@
self.runCmd("help disasm", check=False)
self.runCmd("help unsigned-integer")
+ @no_debug_info_test
+ def test_help_memory_read_should_not_crash_lldb(self):
+ """Command 'help memory read' should not crash lldb."""
+ self.runCmd("help memory read", check=False)
+
@no_debug_info_test
def test_help_should_not_hang_emacsshell(self):
"""Command 'settings set term-width 0' should not hang the help command."""
Index: lldb/include/lldb/Utility/OptionDefinition.h
===================================================================
--- lldb/include/lldb/Utility/OptionDefinition.h
+++ lldb/include/lldb/Utility/OptionDefinition.h
@@ -12,6 +12,8 @@
#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-private-types.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/MathExtras.h"
+#include <climits>
#include <cstdint>
namespace lldb_private {
@@ -47,7 +49,8 @@
/// Whether this has a short option character.
bool HasShortOption() const {
// See the short_option documentation for more.
- return llvm::isPrint(short_option);
+ return llvm::isUInt<CHAR_BIT>(short_option) &&
+ llvm::isPrint(short_option);
}
};
} // namespace lldb_private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94917.317489.patch
Type: text/x-patch
Size: 1467 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210119/71bc8a13/attachment.bin>
More information about the lldb-commits
mailing list