@@ -920,15 +920,17 @@ impl<'a, 'ctx> LLVMBuilder<'a, 'ctx> {
920920 let di_type = self . get_ditype ( & field_pltype. borrow ( ) , ctx) ;
921921 let debug_type = di_type. unwrap ( ) ;
922922 let td = self . targetmachine . get_target_data ( ) ;
923- let ( size, align) = if matches ! ( * RefCell :: borrow( & field_pltype) , PLType :: Pointer ( _) ) {
924- let ptr = self . context . i8_type ( ) . ptr_type ( AddressSpace :: default ( ) ) ;
925- ( td. get_bit_size ( & ptr) , td. get_abi_alignment ( & ptr) )
926- } else {
927- (
928- debug_type. get_size_in_bits ( ) ,
929- debug_type. get_align_in_bits ( ) ,
930- )
931- } ;
923+ let ( size, align, offset_1) =
924+ if matches ! ( * RefCell :: borrow( & field_pltype) , PLType :: Pointer ( _) ) {
925+ let ptr = self . context . i8_type ( ) . ptr_type ( AddressSpace :: default ( ) ) ;
926+ ( td. get_bit_size ( & ptr) , td. get_abi_alignment ( & ptr) , 0 )
927+ } else {
928+ (
929+ debug_type. get_size_in_bits ( ) ,
930+ debug_type. get_align_in_bits ( ) ,
931+ debug_type. get_offset_in_bits ( ) ,
932+ )
933+ } ;
932934 (
933935 self . dibuilder
934936 . create_member_type (
@@ -938,7 +940,7 @@ impl<'a, 'ctx> LLVMBuilder<'a, 'ctx> {
938940 field. range . start . line as u32 ,
939941 size,
940942 align,
941- offset + debug_type . get_offset_in_bits ( ) ,
943+ offset + offset_1 ,
942944 DIFlags :: PUBLIC ,
943945 debug_type,
944946 )
@@ -968,7 +970,6 @@ impl<'a, 'ctx> LLVMBuilder<'a, 'ctx> {
968970 . get_basic_type_op ( & arr. element_type . borrow ( ) , ctx)
969971 . unwrap ( ) ;
970972 let arr_st_tp = self . arr_type ( arr, ctx) . into_struct_type ( ) ;
971- let size = 0 ;
972973 let align = td. get_preferred_alignment ( etp) ;
973974 let st_size = td. get_bit_size ( & arr_st_tp) ;
974975 let vtabledi = self . get_ditype ( & PLType :: Primitive ( PriType :: U64 ) , ctx) ?;
@@ -986,12 +987,18 @@ impl<'a, 'ctx> LLVMBuilder<'a, 'ctx> {
986987 ) ;
987988 let arrdi = self
988989 . dibuilder
989- . create_array_type ( elemdi, size, align, & [ ( 0 ..0 ) ] )
990+ . create_pointer_type (
991+ "arr" ,
992+ elemdi,
993+ elemdi. get_size_in_bits ( ) ,
994+ elemdi. get_align_in_bits ( ) ,
995+ AddressSpace :: default ( ) ,
996+ )
990997 . as_type ( ) ;
991998 let offset = td. offset_of_element ( & arr_st_tp, 1 ) . unwrap ( ) ;
992999 let arrtp = self . dibuilder . create_member_type (
9931000 self . get_cur_di_file ( ) . as_debug_info_scope ( ) ,
994- "array " ,
1001+ "_arr " ,
9951002 self . get_cur_di_file ( ) ,
9961003 0 ,
9971004 arrdi. get_size_in_bits ( ) ,
0 commit comments