Skip to content

Commit

Permalink
[1.8>master] [1.7>1.8] [MERGE #4252 @MSLaguana] Fixing x86 stack walk…
Browse files Browse the repository at this point in the history
…ing issue.

Merge pull request #4252 from MSLaguana:fixStackWalk

The code to deal with x86 aligned return values was too loose, occasionally resulting in missing stack frames. This change tries to more accurately determine when the return value has shifted due to alignment.
  • Loading branch information
MSLaguana committed Nov 18, 2017
2 parents 0c854e6 + e2bbae9 commit 2cc975f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Runtime/Language/JavascriptStackWalker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,9 @@ namespace Js
// Under some odd cases on x86, addressOfReturnAddress and stashed entry address need to be aligned.
// This happens when code is generated using two stack pointers. One or both have the address of
// return address offset by 4, 8, or 12.
|| ((uint)addressOfReturnAddress & ~0xFF) == ((uint)nativeLibraryEntryAddress & ~0xFF)
|| (((uint)nativeLibraryEntryAddress - (uint)addressOfReturnAddress < 0x10) &&
*(void**)addressOfReturnAddress == *(void**)nativeLibraryEntryAddress
)
#endif
;
}
Expand Down

0 comments on commit 2cc975f

Please sign in to comment.