From b76425a16c1f8cecd436372ee2b849b4de4e4490 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Tue, 10 Jan 2023 21:36:51 +0100 Subject: [PATCH] Follow the same logic for exporting symbols with MonoPInvokeCallbackAttribute --- src/mono/mono/mini/aot-compiler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index 4270dcac0fd6e..40080643287dd 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -5208,9 +5208,9 @@ add_wrappers (MonoAotCompile *acfg) MONO_DISABLE_WARNING (4310) // cast truncates constant value g_assert (*named != (char)0xFF); MONO_RESTORE_WARNING - slen = mono_metadata_decode_value (named, &named); + slen = mono_metadata_decode_value (named, &named) + (int)strlen(acfg->user_symbol_prefix); export_name = (char *)g_malloc (slen + 1); - memcpy (export_name, named, slen); + sprintf (export_name, "%s%s", acfg->user_symbol_prefix, named); export_name [slen] = 0; named += slen; }