From f0daa9c6cc9de70917e0ad75a3d1c172713a26b2 Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Fri, 8 Sep 2023 13:27:55 -0400 Subject: [PATCH] [mono] Dont' use bareword `bool` in icall sig macros It will expand to `_Bool` in C11 and mess things up. Use `boolean` instead Fixes https://github.com/dotnet/runtime/issues/91779 --- src/mono/mono/metadata/icall-signatures.h | 8 ++++---- src/mono/mono/metadata/icall.c | 5 ++--- src/mono/mono/mini/aot-compiler.c | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/mono/mono/metadata/icall-signatures.h b/src/mono/mono/metadata/icall-signatures.h index d45f1a569c31e..221fcae8d5886 100644 --- a/src/mono/mono/metadata/icall-signatures.h +++ b/src/mono/mono/metadata/icall-signatures.h @@ -57,7 +57,7 @@ // mono_icall_sig_void_int32 // mono_icall_sig_void_object // mono_icall_sig_void_ptr -// mono_icall_sig_bool_ptr_ptrref +// mono_icall_sig_boolean_ptr_ptrref // mono_icall_sig_double_double_double // mono_icall_sig_float_float_float // mono_icall_sig_int_obj_ptr @@ -94,7 +94,7 @@ // mono_icall_sig_void_ptr_ptr // mono_icall_sig_void_ptr_ptrref // mono_icall_sig_void_uint32_ptrref -// mono_icall_sig_bool_ptr_int32_ptrref +// mono_icall_sig_boolean_ptr_int32_ptrref // mono_icall_sig_int32_int32_ptr_ptrref // mono_icall_sig_int32_ptr_int32_ptr // mono_icall_sig_int32_ptr_int32_ptrref @@ -182,7 +182,7 @@ ICALL_SIG (2, (void, int)) \ ICALL_SIG (2, (void, int32)) \ ICALL_SIG (2, (void, object)) \ ICALL_SIG (2, (void, ptr)) \ -ICALL_SIG (3, (bool, ptr, ptrref)) \ +ICALL_SIG (3, (boolean, ptr, ptrref)) \ ICALL_SIG (3, (double, double, double)) \ ICALL_SIG (3, (float, float, float)) \ ICALL_SIG (3, (int, obj, ptr)) \ @@ -222,7 +222,7 @@ ICALL_SIG (3, (void, ptr, object)) \ ICALL_SIG (3, (void, ptr, ptr)) \ ICALL_SIG (3, (void, ptr, ptrref)) \ ICALL_SIG (3, (void, uint32, ptrref)) \ -ICALL_SIG (4, (bool, ptr, int32, ptrref)) \ +ICALL_SIG (4, (boolean, ptr, int32, ptrref)) \ ICALL_SIG (4, (int32, int32, ptr, ptrref)) \ ICALL_SIG (4, (int32, ptr, int32, ptr)) \ ICALL_SIG (4, (int32, ptr, int32, ptrref)) \ diff --git a/src/mono/mono/metadata/icall.c b/src/mono/mono/metadata/icall.c index c5c21f7ec75fc..75d06bace0fe8 100644 --- a/src/mono/mono/metadata/icall.c +++ b/src/mono/mono/metadata/icall.c @@ -7186,8 +7186,7 @@ mono_lookup_icall_symbol (MonoMethod *m) // // mono_create_icall_signatures depends on this order. Handle with care. typedef enum ICallSigType { - ICALL_SIG_TYPE_bool = 0x00, - ICALL_SIG_TYPE_boolean = ICALL_SIG_TYPE_bool, + ICALL_SIG_TYPE_boolean = 0x00, ICALL_SIG_TYPE_double = 0x01, ICALL_SIG_TYPE_float = 0x02, ICALL_SIG_TYPE_int = 0x03, @@ -7265,7 +7264,7 @@ mono_create_icall_signatures (void) typedef gsize G_MAY_ALIAS gsize_a; MonoType * const lookup [ ] = { - m_class_get_byval_arg (mono_defaults.boolean_class), // ICALL_SIG_TYPE_bool + m_class_get_byval_arg (mono_defaults.boolean_class), // ICALL_SIG_TYPE_boolean m_class_get_byval_arg (mono_defaults.double_class), // ICALL_SIG_TYPE_double m_class_get_byval_arg (mono_defaults.single_class), // ICALL_SIG_TYPE_float m_class_get_byval_arg (mono_defaults.int32_class), // ICALL_SIG_TYPE_int diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index a5fbebee0c5e9..2cd2dbc234f21 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -14612,8 +14612,8 @@ add_preinit_got_slots (MonoAotCompile *acfg) #ifndef MONO_ARCH_HAVE_INTERP_ENTRY_TRAMPOLINE static MonoMethodSignature * const * const interp_in_static_sigs [] = { - &mono_icall_sig_bool_ptr_int32_ptrref, - &mono_icall_sig_bool_ptr_ptrref, + &mono_icall_sig_boolean_ptr_int32_ptrref, + &mono_icall_sig_boolean_ptr_ptrref, &mono_icall_sig_int32_int32_ptrref, &mono_icall_sig_int32_int32_ptr_ptrref, &mono_icall_sig_int32_ptr_int32_ptr,