Skip to content

Commit c630359

Browse files
committed
trans: Decide whether to load volatile_store's argument based on its ArgType.
1 parent d6689e5 commit c630359

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc_trans/trans/intrinsic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,10 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
589589
},
590590
(_, "volatile_store") => {
591591
let tp_ty = *substs.types.get(FnSpace, 0);
592-
let val = if type_is_immediate(bcx.ccx(), tp_ty) {
593-
from_immediate(bcx, llargs[1])
594-
} else {
592+
let val = if fn_ty.args[0].is_indirect() {
595593
Load(bcx, llargs[1])
594+
} else {
595+
from_immediate(bcx, llargs[1])
596596
};
597597
let ptr = PointerCast(bcx, llargs[0], val_ty(val).ptr_to());
598598
let store = VolatileStore(bcx, val, ptr);

0 commit comments

Comments
 (0)