File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -4029,11 +4029,6 @@ fn trans_args(@block_ctxt cx,
4029
4029
auto re = trans_expr( bcx, e) ;
4030
4030
val = re. val;
4031
4031
bcx = re. bcx;
4032
- if ( mode == ast. val) {
4033
- // Until here we've been treating structures by pointer;
4034
- // we are now passing it as an arg, so need to load it.
4035
- val = bcx. build. Load ( val) ;
4036
- }
4037
4032
} else if ( mode == ast. alias) {
4038
4033
let lval_result lv;
4039
4034
if ( ty. is_lval( e) ) {
@@ -4063,9 +4058,25 @@ fn trans_args(@block_ctxt cx,
4063
4058
4064
4059
if ( ty. count_ty_params( args. ( i) . ty) > 0 u) {
4065
4060
auto lldestty = arg_tys. ( i) ;
4061
+ if ( mode == ast. val) {
4062
+ // FIXME: we'd prefer to use &&, but rustboot doesn't like it
4063
+ if ( ty. type_is_structural( ty. expr_ty( e) ) ) {
4064
+ lldestty = T_ptr ( lldestty) ;
4065
+ }
4066
+ }
4067
+
4066
4068
val = bcx. build. PointerCast ( val, lldestty) ;
4067
4069
}
4068
4070
4071
+ if ( mode == ast. val) {
4072
+ // FIXME: we'd prefer to use &&, but rustboot doesn't like it
4073
+ if ( ty. type_is_structural( ty. expr_ty( e) ) ) {
4074
+ // Until here we've been treating structures by pointer;
4075
+ // we are now passing it as an arg, so need to load it.
4076
+ val = bcx. build. Load ( val) ;
4077
+ }
4078
+ }
4079
+
4069
4080
llargs += vec( val) ;
4070
4081
i += 1 u;
4071
4082
}
You can’t perform that action at this time.
0 commit comments