Use write_immediate.

This commit is contained in:
Camille GILLOT 2023-09-11 16:10:27 +00:00
parent 7493ad0abe
commit 6984030f80

View File

@ -221,8 +221,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
sym::discriminant_value => {
let place = self.deref_pointer(&args[0])?;
let variant = self.read_discriminant(&place)?;
let discr = self.discriminant_for_variant(place.layout, variant)?.to_scalar();
self.write_scalar(discr, dest)?;
let discr = self.discriminant_for_variant(place.layout, variant)?;
self.write_immediate(*discr, dest)?;
}
sym::exact_div => {
let l = self.read_immediate(&args[0])?;