From 33bdf1a1bad155e658c9ddd926b1d4993a7bb508 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Tue, 21 May 2019 16:31:11 +0200 Subject: [PATCH] [interp] add missing enum check on constrained callvirt This detail got lost when the code was duplicated here: https://github.com/mono/mono/pull/13154/files#diff-f115ce23fba6528256a47e2b7e8b0a19R1611 Fixes `mono/tests/dim-constrainedcall.il` on the interpreter. This PR will enable it: https://github.com/mono/mono/pull/14166 Commit migrated from https://github.com/mono/mono/commit/539e3f8546b77fec2b5888d66b1e05bfa6bcbde8 --- src/mono/mono/mini/interp/transform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 197f6d9061af73..2714ba483a0e2b 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -1896,7 +1896,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target * but that type doesn't override the method we're * calling, so we need to box `this'. */ - if ((td->sp - csignature->param_count - 1)->type == STACK_TYPE_MP) { + if (target_method->klass == mono_defaults.enum_class && (td->sp - csignature->param_count - 1)->type == STACK_TYPE_MP) { /* managed pointer on the stack, we need to deref that puppy */ /* Always load the entire stackval, to handle also the case where the enum has long storage */ interp_add_ins (td, MINT_LDIND_I8);