From c3c0a9733b24fdb9d0ee4b9be44606f41413cae8 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Tue, 9 Apr 2024 14:25:38 -0700 Subject: [PATCH] Component linking fix --- src/mono/mono/metadata/metadata-internals.h | 4 ++-- src/mono/mono/metadata/metadata.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/metadata/metadata-internals.h b/src/mono/mono/metadata/metadata-internals.h index d0b1f4eb814e63..d546da50b5a473 100644 --- a/src/mono/mono/metadata/metadata-internals.h +++ b/src/mono/mono/metadata/metadata-internals.h @@ -1147,7 +1147,7 @@ typedef struct { MonoTableInfo *t; /* pointer to the table */ // optimization data - gboolean metadata_has_updates; + gint32 metadata_has_updates; // -1: uninitialized. 0/1: value const char * t_base; guint t_row_size; guint32 t_rows; @@ -1173,7 +1173,7 @@ locator_init (MonoTableInfo *t, guint32 idx, guint32 col_idx) return result; // optimization data for decode_locator_row - result.metadata_has_updates = mono_metadata_has_updates (); + result.metadata_has_updates = -1; result.t_base = t->base; result.t_row_size = t->row_size; result.t_rows = table_info_get_rows (t); diff --git a/src/mono/mono/metadata/metadata.c b/src/mono/mono/metadata/metadata.c index 91de2dfe27596e..47f31e97b7d51e 100644 --- a/src/mono/mono/metadata/metadata.c +++ b/src/mono/mono/metadata/metadata.c @@ -4684,7 +4684,9 @@ decode_locator_row (locator_t *loc, int row_index) { const char *data; - if (G_UNLIKELY (loc->metadata_has_updates)) + if (G_UNLIKELY (loc->metadata_has_updates < 0)) + loc->metadata_has_updates = mono_metadata_has_updates (); + if (G_UNLIKELY (loc->metadata_has_updates > 0)) return mono_metadata_decode_row_col_slow (loc->t, row_index, loc->col_idx); // g_assert (col < mono_metadata_table_count (bitfield));