_ => {}
}
+ if self.tcx.lang_items().align_offset_fn() == Some(instance.def.def_id()) {
+ // FIXME: return a real value in case the target allocation has an
+ // alignment bigger than the one requested
+ let n = u128::max_value();
+ let amt = 128 - self.memory.pointer_size().bytes() * 8;
+ let (dest, return_to_block) = destination.unwrap();
+ let ty = self.tcx.types.usize;
+ self.write_scalar(dest, Scalar::from_u128((n << amt) >> amt), ty)?;
+ self.goto_block(return_to_block);
+ return Ok(true);
+ }
+
let mir = match self.load_mir(instance.def) {
Ok(mir) => mir,
Err(EvalError { kind: EvalErrorKind::NoMirFor(path), .. }) => {
let intrinsic_name = &self.tcx.item_name(instance.def_id()).as_str()[..];
match intrinsic_name {
- "align_offset" => {
- // FIXME: return a real value in case the target allocation has an
- // alignment bigger than the one requested
- let n = u128::max_value();
- let amt = 128 - self.memory.pointer_size().bytes() * 8;
- self.write_scalar(dest, Scalar::from_u128((n << amt) >> amt), dest_layout.ty)?;
- },
-
"add_with_overflow" => {
self.intrinsic_with_overflow(
mir::BinOp::Add,