diff options
author | monojenkins <jo.shields+jenkins@xamarin.com> | 2020-08-13 19:34:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-13 19:34:37 +0300 |
commit | 66e2b84002f037d7fd07d399f31196f05bd19597 (patch) | |
tree | d235218ca184cbebfa99e73ce3f8791bce540101 | |
parent | d3daacdaa80070c48cd303525ad7a029a7952b0e (diff) |
[aot] Fix an assert which is hit for generic instances with a lot of arguments. (#20239)mono-6.12.0.91
The c# compiler generates these for anonymous types.
Fixes https://github.com/xamarin/xamarin-macios/issues/9289.
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
-rw-r--r-- | mono/mini/aot-compiler.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c index a30b0ef3593..75349775cf5 100644 --- a/mono/mini/aot-compiler.c +++ b/mono/mini/aot-compiler.c @@ -3386,12 +3386,14 @@ get_shared_ginst_ref (MonoAotCompile *acfg, MonoGenericInst *ginst) guint32 offset = GPOINTER_TO_UINT (g_hash_table_lookup (acfg->ginst_blob_hash, ginst)); if (!offset) { guint8 *buf2, *p2; + int len; - buf2 = (guint8 *)g_malloc (1024); + len = 1024 + (ginst->type_argc * 32); + buf2 = (guint8 *)g_malloc (len); p2 = buf2; encode_ginst (acfg, ginst, p2, &p2); - g_assert (p2 - buf2 < 1024); + g_assert (p2 - buf2 < len); offset = add_to_blob (acfg, buf2, p2 - buf2); g_free (buf2); |