[llvm] a01a406 - [llvm][utils] Fix innocuous off by one in lldb formatters
Dave Lee via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 26 08:10:47 PST 2021
Author: Dave Lee
Date: 2021-02-26T08:10:41-08:00
New Revision: a01a406bba8ac624a876f8d5720e1d4949a5b0fa
URL: https://github.com/llvm/llvm-project/commit/a01a406bba8ac624a876f8d5720e1d4949a5b0fa
DIFF: https://github.com/llvm/llvm-project/commit/a01a406bba8ac624a876f8d5720e1d4949a5b0fa.diff
LOG: [llvm][utils] Fix innocuous off by one in lldb formatters
num_children is "last_index" + 1, thus
num_children + 1 = "last_index" + 2
this worked anyway because the index of `$$dereference$$` would work as long as
it was past the last index.
Added:
Modified:
llvm/utils/lldbDataFormatters.py
Removed:
################################################################################
diff --git a/llvm/utils/lldbDataFormatters.py b/llvm/utils/lldbDataFormatters.py
index b759ee0309a1..4dff5b0a9f49 100644
--- a/llvm/utils/lldbDataFormatters.py
+++ b/llvm/utils/lldbDataFormatters.py
@@ -132,7 +132,7 @@ def num_children(self):
def get_child_index(self, name):
if name == '$$dereference$$':
- return self.valobj.num_children + 1
+ return self.valobj.num_children
return self.valobj.GetIndexOfChildWithName(name)
def get_child_at_index(self, index):
More information about the llvm-commits
mailing list