From 972f726d0379c42e1db4a4b9d92536a4331b0464 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Thu, 14 May 2015 21:55:04 -0400 Subject: [PATCH] [runtime] Avoid allocating interface offsets multiple times. Fixes #28398 setup_interface_offsets will be called multiple times. The code was originally designed to avoid setting up this multiple times but a change to avoid making it assert when used from SRE made it so that the check to avoid multiple initialization would effectively make it be initialized multiple times. See 628e025476f1e8781502eb9ee44bc94911229c36 for the original change. --- mono/metadata/class.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mono/metadata/class.c b/mono/metadata/class.c index dcf15c3b1ce..9c350c0e2a5 100644 --- a/mono/metadata/class.c +++ b/mono/metadata/class.c @@ -3621,8 +3621,9 @@ setup_interface_offsets (MonoClass *class, int cur_slot, gboolean overwrite) * mono_class_setup_interface_offsets () passes 0 as CUR_SLOT, so the computed interface offsets will be invalid. This * means we have to overwrite those when called from other places (#4440). */ - if (class->interfaces_packed && !overwrite) { - g_assert (class->interface_offsets_count == interface_offsets_count); + if (class->interfaces_packed) { + if (!overwrite) + g_assert (class->interface_offsets_count == interface_offsets_count); } else { uint8_t *bitmap; int bsize; -- 2.11.4.GIT