Skip to content

Commit

Permalink
[mono] Dont' use bareword bool in icall sig macros
Browse files Browse the repository at this point in the history
It will expand to `_Bool` in C11 and mess things up.

Use `boolean` instead

Fixes dotnet#91779
  • Loading branch information
lambdageek committed Oct 6, 2023
1 parent 2b4cf8d commit f0daa9c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/mono/mono/metadata/icall-signatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)) \
Expand Down Expand Up @@ -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)) \
Expand Down
5 changes: 2 additions & 3 deletions src/mono/mono/metadata/icall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/mono/mono/mini/aot-compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f0daa9c

Please sign in to comment.