提交 3405c548 编写于 作者: E Elliott Slaughter

gc: Avoid freeing null pointers.

上级 9ea4afe5
......@@ -102,6 +102,12 @@ unsafe fn walk_gc_roots(mem: Memory, visitor: Visitor) {
match sp {
Some(sp_info) => {
for walk_safe_point(frame.fp, sp_info) |root, tydesc| {
// Skip null pointers, which can occur when a
// unique pointer has already been freed.
if ptr::is_null(*root) {
again;
}
if ptr::is_null(tydesc) {
// Root is a generic box.
let refcount = **root;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册