mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 13:40:15 +03:00
Throw unsupported error when alignment is not a power of two
This commit is contained in:
@@ -60,6 +60,11 @@ fn align_offset(
|
||||
this.pointer_size()
|
||||
)? as usize;
|
||||
|
||||
// FIXME: This should actually panic in the interpreted program
|
||||
if !req_align.is_power_of_two() {
|
||||
throw_unsup_format!("Required alignment should always be a power of two")
|
||||
}
|
||||
|
||||
let ptr_scalar = this.read_scalar(ptr_op)?.not_undef()?;
|
||||
|
||||
if let Scalar::Ptr(ptr) = ptr_scalar {
|
||||
|
||||
Reference in New Issue
Block a user