projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0b4ae34
)
[lldb][NFC] Assert on invalid cursors positions when creating CompletionRequest
author
Raphael Isemann
<teemperor@gmail.com>
Fri, 9 Aug 2019 14:32:50 +0000
(14:32 +0000)
committer
Raphael Isemann
<teemperor@gmail.com>
Fri, 9 Aug 2019 14:32:50 +0000
(14:32 +0000)
Before we just triggered undefined behavior on invalid positions.
llvm-svn: 368444
lldb/source/Utility/CompletionRequest.cpp
patch
|
blob
|
history
diff --git
a/lldb/source/Utility/CompletionRequest.cpp
b/lldb/source/Utility/CompletionRequest.cpp
index ca109a9a716ae52b54c42d5d0a14db50e0fe727f..6a8ab160c4169a2e724130d799eb3e0a5ee2539d 100644
(file)
--- a/
lldb/source/Utility/CompletionRequest.cpp
+++ b/
lldb/source/Utility/CompletionRequest.cpp
@@
-16,6
+16,7
@@
CompletionRequest::CompletionRequest(llvm::StringRef command_line,
CompletionResult &result)
: m_command(command_line), m_raw_cursor_pos(raw_cursor_pos),
m_result(result) {
+ assert(raw_cursor_pos <= command_line.size() && "Out of bounds cursor?");
// We parse the argument up to the cursor, so the last argument in
// parsed_line is the one containing the cursor, and the cursor is after the