From 9aaf6027cae3fe92e5d5903adaddfd1b0dbdb1fa Mon Sep 17 00:00:00 2001 From: Austin Wise Date: Tue, 23 Apr 2024 20:51:46 -0700 Subject: [PATCH] [mono] Fix condition for disabling extra checks in verify_class_overrides (#101445) `ENABLE_CHECKED_BUILD` is defined to mean "Enable additional checks" and is enabled in checked and debug builds. Therefore this performance optimization should be enabled when `ENABLE_CHECKED_BUILD` is *not* defined. Ref: #101312 --- src/mono/mono/metadata/class-setup-vtable.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mono/mono/metadata/class-setup-vtable.c b/src/mono/mono/metadata/class-setup-vtable.c index 62afa76dde5b74..b2f13d72dfc47c 100644 --- a/src/mono/mono/metadata/class-setup-vtable.c +++ b/src/mono/mono/metadata/class-setup-vtable.c @@ -773,9 +773,7 @@ mono_method_get_method_definition (MonoMethod *method) static gboolean verify_class_overrides (MonoClass *klass, MonoMethod **overrides, int onum) { - // on windows and arm, we define NDEBUG for release builds - // on browser and wasi, we define DEBUG for debug builds -#ifdef ENABLE_CHECKED_BUILD +#ifndef ENABLE_CHECKED_BUILD if (klass->image == mono_defaults.corlib) return TRUE; #endif