From 7b46eae144e3a6a430155e824fc33e3f38fab427 Mon Sep 17 00:00:00 2001
From: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Date: Wed, 12 Oct 2022 09:53:09 +0200
Subject: [PATCH] [mono][s390x] Fix wrong implementation of OP_CHECK_THIS
* Only access a single byte in memory for OP_CHECK_THIS
* Remove unnecessary ltgr instruction
* Fixes https://github.com/dotnet/runtime/issues/76915
---
src/mono/mono/mini/mini-s390x.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/runtime/src/mono/mono/mini/mini-s390x.c b/src/runtime/src/mono/mono/mini/mini-s390x.c
index 7c7a936ed9701..26e6ba1d32a3b 100644
--- a/src/runtime/src/mono/mono/mini/mini-s390x.c
+++ b/src/runtime/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: {