================
@@ -315,6 +315,19 @@ PyObject 
*lldb_private::python::SWIGBridge::LLDBSwigPython_GetChildAtIndex(PyObj
   return result.release();
 }
 
+static uint32_t ParseIndex(PyObject *implementor, llvm::StringRef name) {
+  unsigned long long retval;
+  if (name.consume_front("[") && !name.consumeInteger(10, retval) && name == 
"]") {
+    // Lazily calculate the number of children (capped to one past the given 
index).
+    uint32_t max = retval + 1;
----------------
bulbazord wrote:

`max` could overflow here if `retval` is `UINT32_MAX` right? Seems like you 
should add a check or exception for that case.

https://github.com/llvm/llvm-project/pull/174885
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to