Rename ArgumentSizeMismatch to ScalarSizeMismatch

This commit is contained in:
Samrat Man Singh 2020-04-26 20:11:14 +05:30
parent 91462db9f1
commit b8af409a51
2 changed files with 5 additions and 5 deletions

View File

@ -362,7 +362,7 @@ pub enum UndefinedBehaviorInfo {
/// Working with a local that is not currently live.
DeadLocal,
/// Data size is not equal to target size
ArgumentSizeMismatch {
ScalarSizeMismatch {
target_size: u64,
data_size: u64,
},
@ -427,9 +427,9 @@ impl fmt::Debug for UndefinedBehaviorInfo {
"using uninitialized data, but this operation requires initialized memory"
),
DeadLocal => write!(f, "accessing a dead local variable"),
ArgumentSizeMismatch { target_size, data_size } => write!(
ScalarSizeMismatch { target_size, data_size } => write!(
f,
"argument size mismatch: expected {} bytes but got {} bytes instead",
"scalar size mismatch: expected {} bytes but got {} bytes instead",
target_size, data_size
),
}

View File

@ -394,9 +394,9 @@ impl<'tcx, Tag> Scalar<Tag> {
match self {
Scalar::Raw { data, size } => {
if target_size.bytes() != u64::from(size) {
throw_ub!(ArgumentSizeMismatch {
throw_ub!(ScalarSizeMismatch {
target_size: target_size.bytes(),
data_size: u64::from(size)
data_size: u64::from(size),
});
}
Scalar::check_data(data, size);