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>
This commit is contained in:
LDj3SNuD 2020-09-20 01:16:30 +02:00 committed by GitHub
parent f60033e0aa
commit 66b799a6e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -144,7 +144,9 @@ namespace ARMeilleure.Instructions
public static void EmitCall(ArmEmitterContext context, ulong immediate) 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) private static void EmitNativeCall(ArmEmitterContext context, Operand nativeContextPtr, Operand funcAddr, bool isJump = false)

View File

@ -21,7 +21,7 @@ namespace ARMeilleure.Translation.PTC
{ {
private const string HeaderMagic = "PTChd"; 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 ActualDir = "0";
private const string BackupDir = "1"; private const string BackupDir = "1";