diff options
author | monojenkins <jo.shields+jenkins@xamarin.com> | 2020-02-04 05:35:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-04 05:35:20 +0300 |
commit | 7deefe779f861439a289360a3ccb90b36bdae458 (patch) | |
tree | c0aecef554440b69962c6bfb164ee0a60bdb0982 | |
parent | 62a57c687c2f7cc1f029447e8a39a77a0414ba22 (diff) |
[aot] Avoid inflating gparams with byreflike types during generic sharing. (#18680)
Fixes https://github.com/mono/mono/issues/18676.
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
-rw-r--r-- | mono/mini/mini-generic-sharing.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mono/mini/mini-generic-sharing.c b/mono/mini/mini-generic-sharing.c index 5ee4434e1d2..531117db7b7 100644 --- a/mono/mini/mini-generic-sharing.c +++ b/mono/mini/mini-generic-sharing.c @@ -1179,6 +1179,9 @@ get_wrapper_shared_vtype (MonoType *t) if (field->type->attrs & (FIELD_ATTRIBUTE_STATIC | FIELD_ATTRIBUTE_HAS_FIELD_RVA)) continue; MonoType *ftype = get_wrapper_shared_type_full (field->type, TRUE); + if (m_class_is_byreflike (mono_class_from_mono_type_internal (ftype))) + /* Cannot inflate generic params with byreflike types */ + return NULL; args [findex ++] = ftype; if (findex >= 16) break; |