From 07fa3a32336d2da5d2bf652ad01d33f18b2debaf Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Thu, 30 Mar 2017 22:06:23 -0400 Subject: [PATCH] Add assert to GCHeap::ValidateObjectMember (#10591) In presence of a corrupt heap, objects can contain null method table. Add assertion to prevent segfault in checked/debug builds. --- src/gc/gc.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp index 9435357..65c6742 100644 --- a/src/gc/gc.cpp +++ b/src/gc/gc.cpp @@ -33501,6 +33501,7 @@ void GCHeap::ValidateObjectMember (Object* obj) { dprintf (3, ("VOM: m: %Ix obj %Ix", (size_t)child_o, o)); MethodTable *pMT = method_table (child_o); + assert(pMT); if (!pMT->SanityCheck()) { dprintf (3, ("Bad member of %Ix %Ix", (size_t)oo, (size_t)child_o)); -- 2.7.4