Skip to content

Commit f383b17

Browse files
committed
Directly use from_immediate for handling bool
1 parent 6c6c31d commit f383b17

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/intrinsic/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -498,13 +498,10 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
498498
};
499499

500500
if result.layout.ty.is_bool() {
501-
OperandRef::from_immediate_or_packed_pair(self, value, result.layout)
502-
.val
503-
.store(self, result);
501+
let val = self.from_immediate(value);
502+
self.store_to_place(val, result.val);
504503
} else if !result.layout.ty.is_unit() {
505-
let ptr_llty = self.type_ptr_to(result.layout.gcc_type(self));
506-
let ptr = self.pointercast(result.val.llval, ptr_llty);
507-
self.store(value, ptr, result.val.align);
504+
self.store_to_place(value, result.val);
508505
}
509506
Ok(())
510507
}

0 commit comments

Comments
 (0)