Skip to content

Commit 6f0cbf4

Browse files
committed
stdlib: Fix a pointer mistake in arenas
1 parent 0d5d2e5 commit 6f0cbf4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libstd/arena.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ impl arena for arena {
3737
end = n_bytes;
3838
}
3939

40-
let p = ptr::offset(ptr::addr_of(head.fill), start);
41-
head.fill = end;
42-
unsafe { ret unsafe::reinterpret_cast(p); }
40+
unsafe {
41+
let p = ptr::offset(vec::unsafe::to_ptr(head.data), start);
42+
head.fill = end;
43+
ret unsafe::reinterpret_cast(p);
44+
}
4345
}
4446
}
4547

0 commit comments

Comments
 (0)