From c492151571250df7045186d5ea1a3b6ec3786cd3 Mon Sep 17 00:00:00 2001 From: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> Date: Tue, 25 Apr 2023 02:28:22 -0700 Subject: [PATCH] Fix EnCFieldIndex check --- src/coreclr/vm/methodtable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/vm/methodtable.cpp b/src/coreclr/vm/methodtable.cpp index b0819cd5d5f57b..a5391fb8b4f763 100644 --- a/src/coreclr/vm/methodtable.cpp +++ b/src/coreclr/vm/methodtable.cpp @@ -2090,7 +2090,7 @@ PTR_FieldDesc MethodTable::GetFieldDescByIndex(DWORD fieldIndex) // Check if the field index is for an EnC field lookup. // See GetIndexForFieldDesc() for when this is applied and why. - if (fieldIndex | EnCFieldIndex) + if ((fieldIndex & EnCFieldIndex) == EnCFieldIndex) { DWORD rid = fieldIndex & ~EnCFieldIndex; LOG((LF_ENC, LL_INFO100, "MT:GFDBI: rid:0x%08x\n", rid));