File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -282,9 +282,13 @@ Interpreter::Visit(const ArraySubscriptNode *node) {
282282 // Check to see if 'base' has a synthetic value; if so, try using that.
283283 uint64_t child_idx = node->GetIndex ();
284284 if (lldb::ValueObjectSP synthetic = base->GetSyntheticValue ()) {
285- uint32_t num_children = synthetic->GetNumChildrenIgnoringErrors ();
285+ llvm::Expected<uint32_t > num_children =
286+ synthetic->GetNumChildren (child_idx + 1 );
287+ if (!num_children)
288+ return llvm::make_error<DILDiagnosticError>(
289+ m_expr, toString (num_children.takeError ()), node->GetLocation ());
286290 // Verify that the 'index' is not out-of-range for the declared type.
287- if (child_idx >= num_children) {
291+ if (child_idx >= * num_children) {
288292 std::string message = llvm::formatv (
289293 " array index {0} is not valid for \" ({1}) {2}\" " , child_idx,
290294 base->GetTypeName ().AsCString (" <invalid type>" ),
You can’t perform that action at this time.
0 commit comments