Use the destination type size instead of the source type size
This commit is contained in:
parent
edbdf3d263
commit
1550fd212b
@ -21,7 +21,7 @@ pub(super) fn cast_primval(
|
||||
Scalar::Bits { defined: 0, .. } => Ok(val),
|
||||
Scalar::Ptr(ptr) => self.cast_from_ptr(ptr, dest_ty),
|
||||
Scalar::Bits { bits, .. } => {
|
||||
// TODO(oli-obk): impl scalar_size for floats and check defined bits here
|
||||
// TODO(oli-obk): check defined bits here
|
||||
match src_ty.sty {
|
||||
TyFloat(fty) => self.cast_from_float(bits, fty, dest_ty),
|
||||
_ => self.cast_from_int(bits, src_ty, dest_ty),
|
||||
|
Loading…
Reference in New Issue
Block a user