[cross] check against correct alignment value (#31801)
authormonojenkins <jo.shields+jenkins@xamarin.com>
Mon, 17 Feb 2020 13:22:12 +0000 (08:22 -0500)
committerGitHub <noreply@github.com>
Mon, 17 Feb 2020 13:22:12 +0000 (14:22 +0100)
It's essentially dead code in any of our configurations.

`MONO_ALIGN_gint8` is define here:
https://github.com/mono/mono/blob/ab2321c1dc1bf0293dadd7e52436b2bd87f2b7c3/mono/metadata/abi-details.h#L26-L35

And the correct value is set here:
https://github.com/mono/mono/blob/ab2321c1dc1bf0293dadd7e52436b2bd87f2b7c3/mono/metadata/abi.c#L71-L75

Co-authored-by: Bernhard Urban-Forster <bernhard.urban@xamarin.com>
src/mono/mono/metadata/metadata-cross-helpers.c
src/mono/mono/mini/mini-cross-helpers.c

index 566eb2b..3a9be46 100644 (file)
@@ -157,7 +157,7 @@ mono_metadata_cross_helpers_run (void)
        }
 #define DECL_ALIGN(type) this_should_not_happen_for_cross_align
 #define DECL_ALIGN2(name,size) \
-        if (MONO_ALIGN_ ## name != size) { \
+        if (mono_abi_alignment (MONO_ALIGN_ ## name) != size) { \
                g_print (#name ": invalid alignment %d (expected %d)\n",        \
                size,   \
                MONO_ALIGN_ ## name);   \
index 898e4b7..d456b4a 100644 (file)
@@ -84,7 +84,7 @@ mono_cross_helpers_run (void)
        }
 #define DECL_ALIGN(name,type) this_should_not_happen_for_cross_align
 #define DECL_ALIGN2(name,size) \
-        if (MONO_ALIGN_ ## name != size) { \
+        if (mono_abi_alignment (MONO_ALIGN_ ## name) != size) { \
                g_print (#name ": invalid alignment %d (expected %d)\n",        \
                size,   \
                MONO_ALIGN_ ## name);   \