Skip to content

Commit

Permalink
[llvm][utils] Fix innocuous off by one in lldb formatters
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kastiglione committed Feb 26, 2021
1 parent 740e69b commit a01a406
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/utils/lldbDataFormatters.py
Expand Up @@ -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):
Expand Down

0 comments on commit a01a406

Please sign in to comment.