Fix bug where &str's lengths were not copied.
This commit is contained in:
parent
acf2ceb534
commit
62fab9268e
1 changed files with 1 additions and 1 deletions
|
@ -708,7 +708,7 @@ impl<'a, 'tcx: 'a, 'arena> Interpreter<'a, 'tcx, 'arena> {
|
|||
let pointee_ty = pointee_type(base_ty).expect("Deref of non-pointer");
|
||||
let ptr = try!(self.memory.read_ptr(base_ptr));
|
||||
let extra = match pointee_ty.sty {
|
||||
ty::TySlice(_) => {
|
||||
ty::TySlice(_) | ty::TyStr => {
|
||||
let len_ptr = base_ptr.offset(self.memory.pointer_size as isize);
|
||||
let len = try!(self.memory.read_usize(len_ptr));
|
||||
LvalueExtra::Length(len)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue