From 075e74ed1356f2e5bb978ac541633ab46e34bf99 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Oct 2022 11:08:29 -0700 Subject: [PATCH] [mono][s390x] Fix wrong implementation of OP_CHECK_THIS (#76920) * Only access a single byte in memory for OP_CHECK_THIS * Remove unnecessary ltgr instruction * Fixes https://github.com/dotnet/runtime/issues/76915 Co-authored-by: Ulrich Weigand --- src/mono/mono/mini/mini-s390x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mono/mono/mini/mini-s390x.c b/src/mono/mono/mini/mini-s390x.c index 7c7a936ed9701..26e6ba1d32a3b 100644 --- a/src/mono/mono/mini/mini-s390x.c +++ b/src/mono/mono/mini/mini-s390x.c @@ -3594,8 +3594,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_CHECK_THIS: { /* ensure ins->sreg1 is not NULL */ - s390_lg (code, s390_r0, 0, ins->sreg1, 0); - s390_ltgr (code, s390_r0, s390_r0); + s390_llgc (code, s390_r0, 0, ins->sreg1, 0); } break; case OP_ARGLIST: {