Skip to content

Commit 17910d0

Browse files
committed
[MERGE #4252 @MSLaguana] Fixing x86 stack walking 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.
2 parents fffb4e2 + 340a4bb commit 17910d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Runtime/Language/JavascriptStackWalker.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,9 @@ namespace Js
853853
// Under some odd cases on x86, addressOfReturnAddress and stashed entry address need to be aligned.
854854
// This happens when code is generated using two stack pointers. One or both have the address of
855855
// return address offset by 4, 8, or 12.
856-
|| ((uint)addressOfReturnAddress & ~0xFF) == ((uint)nativeLibraryEntryAddress & ~0xFF)
856+
|| (((uint)nativeLibraryEntryAddress - (uint)addressOfReturnAddress < 0x10) &&
857+
*(void**)addressOfReturnAddress == *(void**)nativeLibraryEntryAddress
858+
)
857859
#endif
858860
;
859861
}

0 commit comments

Comments
 (0)