[sgen] Avoid allocating mod union cardtables for los objects when scanning
[mono.git] / mono / sgen / sgen-los.c
index 68f5b933f12eed386fb751e1de38a274f69c15bf..e61ba557818f7ac6516d3c5ccff295d113cde566 100644 (file)
@@ -644,6 +644,9 @@ sgen_los_scan_card_table (CardTableScanType scan_type, ScanCopyContext ctx, int
                        if (!sgen_los_object_is_pinned (obj->data))
                                continue;
 
+                       if (!obj->cardtable_mod_union)
+                               continue;
+
                        cards = get_cardtable_mod_union_for_object (obj);
                        g_assert (cards);
                        if (scan_type == CARDTABLE_SCAN_MOD_UNION_PRECLEAN) {