mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-17 21:26:38 +00:00
Add bounds to address table on ARMeilleure
This commit is contained in:
parent
63cbd819f8
commit
76f2b3d089
2 changed files with 8 additions and 6 deletions
|
@ -211,9 +211,12 @@ namespace ARMeilleure.Instructions
|
|||
// Deliberately attempts to avoid branches.
|
||||
|
||||
var level0 = table.Levels[0];
|
||||
int clearBits0 = 64 - (level0.Index + level0.Length);
|
||||
|
||||
// Currently no bounds check. Maybe conditionally do this for unsafe host mapped.
|
||||
Operand index = context.ShiftLeft(context.ShiftRightUI(guestAddress, Const(level0.Index)), Const(3));
|
||||
Operand index = context.ShiftLeft(
|
||||
context.ShiftRightUI(context.ShiftLeft(guestAddress, Const(clearBits0)), Const(clearBits0 + level0.Index)),
|
||||
Const(3)
|
||||
);
|
||||
|
||||
Operand tableBase = !context.HasPtc ?
|
||||
Const(table.Base) :
|
||||
|
@ -223,11 +226,10 @@ namespace ARMeilleure.Instructions
|
|||
|
||||
// Second level
|
||||
var level1 = table.Levels[1];
|
||||
|
||||
int clearBits = 64 - (level1.Index + level1.Length);
|
||||
int clearBits1 = 64 - (level1.Index + level1.Length);
|
||||
|
||||
Operand index2 = context.ShiftLeft(
|
||||
context.ShiftRightUI(context.ShiftLeft(guestAddress, Const(clearBits)), Const(clearBits + level1.Index)),
|
||||
context.ShiftRightUI(context.ShiftLeft(guestAddress, Const(clearBits1)), Const(clearBits1 + level1.Index)),
|
||||
Const(3)
|
||||
);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace ARMeilleure.Translation.PTC
|
|||
private const string OuterHeaderMagicString = "PTCohd\0\0";
|
||||
private const string InnerHeaderMagicString = "PTCihd\0\0";
|
||||
|
||||
private const uint InternalVersion = 26957; //! To be incremented manually for each change to the ARMeilleure project.
|
||||
private const uint InternalVersion = 26958; //! To be incremented manually for each change to the ARMeilleure project.
|
||||
|
||||
private const string ActualDir = "0";
|
||||
private const string BackupDir = "1";
|
||||
|
|
Loading…
Reference in a new issue