@@ -20,6 +20,7 @@ use trans::build;
20
20
use trans:: common:: { self , Block , Result } ;
21
21
use trans:: debuginfo:: DebugLoc ;
22
22
use trans:: declare;
23
+ use trans:: expr;
23
24
use trans:: machine;
24
25
use trans:: type_:: Type ;
25
26
use trans:: type_of;
@@ -55,6 +56,9 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
55
56
56
57
mir:: Rvalue :: Aggregate ( _, ref operands) => {
57
58
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.
58
62
let lldest_i = build:: GEPi ( bcx, lldest, & [ 0 , i] ) ;
59
63
self . trans_operand_into ( bcx, lldest_i, operand) ;
60
64
}
@@ -70,8 +74,10 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
70
74
let llbase1 = build:: GEPi ( bcx, llbase, & [ from_start] ) ;
71
75
let adj = common:: C_uint ( ccx, from_start + from_end) ;
72
76
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) ;
75
81
bcx
76
82
}
77
83
0 commit comments