Skip to content

Commit

Permalink
Fix host stack overflow caused by some recursive guest methods. (#1528)
Browse files Browse the repository at this point in the history
* Fix host stack overflow caused by some recursive guest methods.

* PPTC flag up.

* Address comments.

Co-authored-by: gdkchan <[email protected]>
  • Loading branch information
LDj3SNuD and gdkchan authored Sep 19, 2020
1 parent f60033e commit 66b799a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ARMeilleure/Instructions/InstEmitFlowHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ Operand Inverse(Operand val)

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)
Expand Down
2 changes: 1 addition & 1 deletion ARMeilleure/Translation/PTC/Ptc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static class 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";
Expand Down

0 comments on commit 66b799a

Please sign in to comment.