From fe9ac011d4fc1c82f51b2774521c485148688898 Mon Sep 17 00:00:00 2001 From: Andi McClure Date: Wed, 21 Sep 2016 17:52:51 -0400 Subject: [PATCH] Back out trivial crash when running metadata checked-build mode introduced by f822445711c1 --- mono/utils/checked-build.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mono/utils/checked-build.c b/mono/utils/checked-build.c index 82ce187e9c8..aa6c407c402 100644 --- a/mono/utils/checked-build.c +++ b/mono/utils/checked-build.c @@ -486,7 +486,12 @@ check_image_may_reference_image(MonoImage *from, MonoImage *to) for (inner_idx = 0; !success && inner_idx < checking->nreferences; inner_idx++) { - CHECK_IMAGE_VISIT (checking->references[inner_idx]->image); + // Assembly references are lazy-loaded and thus allowed to be NULL. + // If they are NULL, we don't care about them for this search, because their images haven't impacted ref_count yet. + if (checking->references[inner_idx]) + { + CHECK_IMAGE_VISIT (checking->references[inner_idx]->image); + } } mono_image_unlock (checking); -- 2.25.1