Skip to content

Commit

Permalink
Merge pull request #4160 from asahilina/align-stack
Browse files Browse the repository at this point in the history
FEXLoader: Align stack base
  • Loading branch information
Sonicadvance1 authored Nov 18, 2024
2 parents e675f42 + 4a67893 commit 09bfe58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/Tools/FEXLoader/ELFCodeLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,9 @@ class ELFCodeLoader final : public FEX::CodeLoader {
uint64_t ExecFNLocation = TotalArgumentMemSize;
TotalArgumentMemSize += Args[0].size() + 1;

// Align the argument block to 16 bytes to keep the stack aligned
TotalArgumentMemSize = FEXCore::AlignUp(TotalArgumentMemSize, 16);

// Offset the stack by how much memory we need
StackPointer -= TotalArgumentMemSize;

Expand Down

0 comments on commit 09bfe58

Please sign in to comment.