Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: src/builtins/x64/builtins-x64.cc

Issue 2681643004: [builtins] Fix crash on stack overflow in CheckSpreadAndPushToStack. (Closed)
Patch Set: Also fix for x87 port Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/ia32/builtins-ia32.cc ('k') | src/builtins/x87/builtins-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/x64/builtins-x64.cc
diff --git a/src/builtins/x64/builtins-x64.cc b/src/builtins/x64/builtins-x64.cc
index caf247070a3855bc161520ee476640c9dfd64b29..da7a9f509f6f8729a7da49addd35cba569154cb2 100644
--- a/src/builtins/x64/builtins-x64.cc
+++ b/src/builtins/x64/builtins-x64.cc
@@ -2901,10 +2901,6 @@ static void CheckSpreadAndPushToStack(MacroAssembler* masm) {
__ bind(&push_args);
// rax += r9 - 1. Subtract 1 for the spread itself.
__ leap(rax, Operand(rax, r9, times_1, -1));
-
- // Pop the return address and spread argument.
- __ PopReturnAddressTo(r8);
- __ Pop(rcx);
}
// Check for stack overflow.
@@ -2927,6 +2923,10 @@ static void CheckSpreadAndPushToStack(MacroAssembler* masm) {
// Put the evaluated spread onto the stack as additional arguments.
{
+ // Pop the return address and spread argument.
+ __ PopReturnAddressTo(r8);
+ __ Pop(rcx);
+
__ Set(rcx, 0);
Label done, loop;
__ bind(&loop);
« no previous file with comments | « src/builtins/ia32/builtins-ia32.cc ('k') | src/builtins/x87/builtins-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698