Add assert to GCHeap::ValidateObjectMember (#10591)
authorSteve MacLean <sdmaclea@qti.qualcomm.com>
Fri, 31 Mar 2017 02:06:23 +0000 (22:06 -0400)
committerJan Kotas <jkotas@microsoft.com>
Fri, 31 Mar 2017 02:06:23 +0000 (19:06 -0700)
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

index 9435357..65c6742 100644 (file)
@@ -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));