minor fixes

the FIXME was wrong here, there's no need for any special offsetting
This commit is contained in:
Oliver Schneider
2016-11-15 14:11:44 +01:00
parent 511fa40d23
commit 4a39c228df
+2 -2
View File
@@ -1406,7 +1406,7 @@ fn read_value(&mut self, ptr: Pointer, ty: Ty<'tcx>) -> EvalResult<'tcx, Value>
if self.type_is_sized(ty) {
PrimVal::from_ptr(p)
} else {
// FIXME: extract the offset to the tail field for `Box<(i64, i32, [u8])>`
trace!("reading fat pointer extra of type {}", ty);
let extra = ptr.offset(self.memory.pointer_size() as isize);
let extra = match self.tcx.struct_tail(ty).sty {
ty::TyTrait(..) => PrimVal::from_ptr(self.memory.read_ptr(extra)?),
@@ -1513,7 +1513,7 @@ fn unsize_into(
//let dst = adt::MaybeSizedValue::sized(dst);
let src_ptr = match src {
Value::ByRef(ptr) => ptr,
_ => panic!("expected pointer, got {:?}", src),
_ => bug!("expected pointer, got {:?}", src),
};
let iter = src_fields.zip(dst_fields).enumerate();