@@ -600,15 +600,23 @@ ValueObject *ValueObject::CreateChildAtIndex(size_t idx,
600
600
uint64_t language_flags = 0 ;
601
601
602
602
const bool transparent_pointers = !synthetic_array_member;
603
- CompilerType child_compiler_type;
604
603
605
604
ExecutionContext exe_ctx (GetExecutionContextRef ());
606
605
607
- child_compiler_type = GetCompilerType ().GetChildCompilerTypeAtIndex (
608
- &exe_ctx, idx, transparent_pointers, omit_empty_base_classes,
609
- ignore_array_bounds, child_name_str, child_byte_size, child_byte_offset,
610
- child_bitfield_bit_size, child_bitfield_bit_offset, child_is_base_class,
611
- child_is_deref_of_parent, this , language_flags);
606
+ auto child_compiler_type_or_err =
607
+ GetCompilerType ().GetChildCompilerTypeAtIndex (
608
+ &exe_ctx, idx, transparent_pointers, omit_empty_base_classes,
609
+ ignore_array_bounds, child_name_str, child_byte_size,
610
+ child_byte_offset, child_bitfield_bit_size, child_bitfield_bit_offset,
611
+ child_is_base_class, child_is_deref_of_parent, this , language_flags);
612
+ CompilerType child_compiler_type;
613
+ if (!child_compiler_type_or_err)
614
+ LLDB_LOG_ERROR (GetLog (LLDBLog::Types),
615
+ child_compiler_type_or_err.takeError (),
616
+ " could not find child: {0}" );
617
+ else
618
+ child_compiler_type = *child_compiler_type_or_err;
619
+
612
620
if (child_compiler_type) {
613
621
if (synthetic_index)
614
622
child_byte_offset += child_byte_size * synthetic_index;
@@ -2735,16 +2743,23 @@ ValueObjectSP ValueObject::Dereference(Status &error) {
2735
2743
bool child_is_deref_of_parent = false ;
2736
2744
const bool transparent_pointers = false ;
2737
2745
CompilerType compiler_type = GetCompilerType ();
2738
- CompilerType child_compiler_type;
2739
2746
uint64_t language_flags = 0 ;
2740
2747
2741
2748
ExecutionContext exe_ctx (GetExecutionContextRef ());
2742
2749
2743
- child_compiler_type = compiler_type.GetChildCompilerTypeAtIndex (
2750
+ CompilerType child_compiler_type;
2751
+ auto child_compiler_type_or_err = compiler_type.GetChildCompilerTypeAtIndex (
2744
2752
&exe_ctx, 0 , transparent_pointers, omit_empty_base_classes,
2745
2753
ignore_array_bounds, child_name_str, child_byte_size, child_byte_offset,
2746
2754
child_bitfield_bit_size, child_bitfield_bit_offset, child_is_base_class,
2747
2755
child_is_deref_of_parent, this , language_flags);
2756
+ if (!child_compiler_type_or_err)
2757
+ LLDB_LOG_ERROR (GetLog (LLDBLog::Types),
2758
+ child_compiler_type_or_err.takeError (),
2759
+ " could not find child: {0}" );
2760
+ else
2761
+ child_compiler_type = *child_compiler_type_or_err;
2762
+
2748
2763
if (child_compiler_type && child_byte_size) {
2749
2764
ConstString child_name;
2750
2765
if (!child_name_str.empty ())
0 commit comments