From 4dd23f24d65e05169594bfcb45b84adfe4e52516 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 25 Aug 2011 17:13:06 -0700 Subject: [PATCH] rt: Null check in walk_obj_contents. Prevents marking from crashing when calling object constructors. --- src/rt/rust_shape.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rt/rust_shape.h b/src/rt/rust_shape.h index e8a30d5874a8..060dd7fed406 100644 --- a/src/rt/rust_shape.h +++ b/src/rt/rust_shape.h @@ -903,6 +903,8 @@ data::walk_obj_contents(bool align, ptr &dp) { type_desc *subtydesc = *reinterpret_cast(box_ptr + sizeof(void *)); ptr obj_closure_dp(box_ptr + sizeof(void *)); + if (!box_ptr) // Null check. + return; arena arena; type_param *params = type_param::from_obj_shape(subtydesc->shape,