aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/Instructions/InstEmitFlowHelper.cs
diff options
context:
space:
mode:
authorLDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com>2020-09-20 01:16:30 +0200
committerGitHub <noreply@github.com>2020-09-19 20:16:30 -0300
commit66b799a6e481ed316eeddcfe33a1d4629e47bb44 (patch)
treee60b034dab70b5a5f22819b83a1dba051bdfd2c3 /ARMeilleure/Instructions/InstEmitFlowHelper.cs
parentf60033e0aaf546d7f56a4925b5aeec76709fb851 (diff)
Fix host stack overflow caused by some recursive guest methods. (#1528)
* Fix host stack overflow caused by some recursive guest methods. * PPTC flag up. * Address comments. Co-authored-by: gdkchan <gab.dark.100@gmail.com>
Diffstat (limited to 'ARMeilleure/Instructions/InstEmitFlowHelper.cs')
-rw-r--r--ARMeilleure/Instructions/InstEmitFlowHelper.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/ARMeilleure/Instructions/InstEmitFlowHelper.cs b/ARMeilleure/Instructions/InstEmitFlowHelper.cs
index f5f228f5..0e7ca9ec 100644
--- a/ARMeilleure/Instructions/InstEmitFlowHelper.cs
+++ b/ARMeilleure/Instructions/InstEmitFlowHelper.cs
@@ -144,7 +144,9 @@ namespace ARMeilleure.Instructions
public static void EmitCall(ArmEmitterContext context, ulong immediate)
{
- EmitJumpTableBranch(context, Const(immediate));
+ bool isRecursive = immediate == (ulong)context.BaseAddress;
+
+ EmitJumpTableBranch(context, Const(immediate), isRecursive);
}
private static void EmitNativeCall(ArmEmitterContext context, Operand nativeContextPtr, Operand funcAddr, bool isJump = false)