diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2016-03-18 05:29:53 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2016-03-18 05:29:53 +0200 |
| commit | 181097da3315fa143c686a37d1a0c8b32fe9a3fb (patch) | |
| tree | 4a15b652a7d1de34749ee3d2ace657ca279a88de | |
| parent | d6689e5d1c2fad418e6f37583ba4946c380deb95 (diff) | |
| download | rust-181097da3315fa143c686a37d1a0c8b32fe9a3fb.tar.gz rust-181097da3315fa143c686a37d1a0c8b32fe9a3fb.zip | |
trans: Decide whether to load volatile_store's argument based on its ArgType.
| -rw-r--r-- | src/librustc_trans/trans/intrinsic.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_trans/trans/intrinsic.rs b/src/librustc_trans/trans/intrinsic.rs index 1140edeaec0..43976f8233b 100644 --- a/src/librustc_trans/trans/intrinsic.rs +++ b/src/librustc_trans/trans/intrinsic.rs @@ -589,10 +589,10 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, }, (_, "volatile_store") => { let tp_ty = *substs.types.get(FnSpace, 0); - let val = if type_is_immediate(bcx.ccx(), tp_ty) { - from_immediate(bcx, llargs[1]) - } else { + let val = if fn_ty.args[1].is_indirect() { Load(bcx, llargs[1]) + } else { + from_immediate(bcx, llargs[1]) }; let ptr = PointerCast(bcx, llargs[0], val_ty(val).ptr_to()); let store = VolatileStore(bcx, val, ptr); |
