@@ -20,6 +20,7 @@ use trans::build;
2020use trans:: common:: { self , Block , Result } ;
2121use trans:: debuginfo:: DebugLoc ;
2222use trans:: declare;
23+ use trans:: expr;
2324use trans:: machine;
2425use trans:: type_:: Type ;
2526use trans:: type_of;
@@ -55,6 +56,9 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
5556
5657 mir:: Rvalue :: Aggregate ( _, ref operands) => {
5758 for ( i, operand) in operands. iter ( ) . enumerate ( ) {
59+ // Note: perhaps this should be StructGep, but
60+ // note that in some cases the values here will
61+ // not be structs but arrays.
5862 let lldest_i = build:: GEPi ( bcx, lldest, & [ 0 , i] ) ;
5963 self . trans_operand_into ( bcx, lldest_i, operand) ;
6064 }
@@ -70,8 +74,10 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
7074 let llbase1 = build:: GEPi ( bcx, llbase, & [ from_start] ) ;
7175 let adj = common:: C_uint ( ccx, from_start + from_end) ;
7276 let lllen1 = build:: Sub ( bcx, lllen, adj, DebugLoc :: None ) ;
73- build:: Store ( bcx, llbase1, build:: GEPi ( bcx, lldest, & [ 0 , abi:: FAT_PTR_ADDR ] ) ) ;
74- build:: Store ( bcx, lllen1, build:: GEPi ( bcx, lldest, & [ 0 , abi:: FAT_PTR_EXTRA ] ) ) ;
77+ let lladdrdest = expr:: get_dataptr ( bcx, lldest) ;
78+ build:: Store ( bcx, llbase1, lladdrdest) ;
79+ let llmetadest = expr:: get_meta ( bcx, lldest) ;
80+ build:: Store ( bcx, lllen1, llmetadest) ;
7581 bcx
7682 }
7783
0 commit comments