diff options
author | LDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com> | 2020-09-20 01:16:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-19 20:16:30 -0300 |
commit | 66b799a6e481ed316eeddcfe33a1d4629e47bb44 (patch) | |
tree | e60b034dab70b5a5f22819b83a1dba051bdfd2c3 | |
parent | f60033e0aaf546d7f56a4925b5aeec76709fb851 (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>
-rw-r--r-- | ARMeilleure/Instructions/InstEmitFlowHelper.cs | 4 | ||||
-rw-r--r-- | ARMeilleure/Translation/PTC/Ptc.cs | 2 |
2 files changed, 4 insertions, 2 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) diff --git a/ARMeilleure/Translation/PTC/Ptc.cs b/ARMeilleure/Translation/PTC/Ptc.cs index 89aeed08..c0b59a88 100644 --- a/ARMeilleure/Translation/PTC/Ptc.cs +++ b/ARMeilleure/Translation/PTC/Ptc.cs @@ -21,7 +21,7 @@ namespace ARMeilleure.Translation.PTC { private const string HeaderMagic = "PTChd"; - private const int InternalVersion = 1549; //! To be incremented manually for each change to the ARMeilleure project. + private const int InternalVersion = 1528; //! To be incremented manually for each change to the ARMeilleure project. private const string ActualDir = "0"; private const string BackupDir = "1"; |