Skip to content

Commit f5686e3

Browse files
authored
Write return value for ptr_mask intrinsic (rust-lang#1536)
This was forgotten. Without it, ptr_mask just always returns null.
1 parent 753271c commit f5686e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/intrinsics/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,11 @@ fn codegen_regular_intrinsic_call<'tcx>(
600600

601601
sym::ptr_mask => {
602602
intrinsic_args!(fx, args => (ptr, mask); intrinsic);
603+
let ptr_layout = ptr.layout();
603604
let ptr = ptr.load_scalar(fx);
604605
let mask = mask.load_scalar(fx);
605-
fx.bcx.ins().band(ptr, mask);
606+
let res = fx.bcx.ins().band(ptr, mask);
607+
ret.write_cvalue(fx, CValue::by_val(res, ptr_layout));
606608
}
607609

608610
sym::write_bytes | sym::volatile_set_memory => {

0 commit comments

Comments
 (0)