From: Dave Lee Date: Fri, 26 Feb 2021 16:04:53 +0000 (-0800) Subject: [llvm][utils] Fix innocuous off by one in lldb formatters X-Git-Tag: llvmorg-14-init~13942 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a01a406bba8ac624a876f8d5720e1d4949a5b0fa;p=platform%2Fupstream%2Fllvm.git [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. --- diff --git a/llvm/utils/lldbDataFormatters.py b/llvm/utils/lldbDataFormatters.py index b759ee0..4dff5b0 100644 --- a/llvm/utils/lldbDataFormatters.py +++ b/llvm/utils/lldbDataFormatters.py @@ -132,7 +132,7 @@ class OptionalSynthProvider: 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):