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

Unified Diff: src/builtins/ia32/builtins-ia32.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 | « no previous file | src/builtins/x64/builtins-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/ia32/builtins-ia32.cc
diff --git a/src/builtins/ia32/builtins-ia32.cc b/src/builtins/ia32/builtins-ia32.cc
index aa53f0edf2b575ba1db2b2ac6ff882d379b9c29d..cbd5ea697b81932ade35b31a49af599e648a3dd2 100644
--- a/src/builtins/ia32/builtins-ia32.cc
+++ b/src/builtins/ia32/builtins-ia32.cc
@@ -2842,7 +2842,6 @@ static void CheckSpreadAndPushToStack(MacroAssembler* masm) {
__ movd(xmm1, edi);
}
- Register return_address = edi;
{
// Calculate the new nargs including the result of the spread.
__ mov(spread_len, FieldOperand(spread, FixedArray::kLengthOffset));
@@ -2851,10 +2850,6 @@ static void CheckSpreadAndPushToStack(MacroAssembler* masm) {
__ bind(&push_args);
// argc += spread_len - 1. Subtract 1 for the spread itself.
__ lea(argc, Operand(argc, spread_len, times_1, -1));
-
- // Pop the return address and spread argument.
- __ PopReturnAddressTo(return_address);
- __ Pop(scratch);
}
// Check for stack overflow.
@@ -2877,6 +2872,11 @@ static void CheckSpreadAndPushToStack(MacroAssembler* masm) {
// Put the evaluated spread onto the stack as additional arguments.
{
+ Register return_address = edi;
+ // Pop the return address and spread argument.
+ __ PopReturnAddressTo(return_address);
+ __ Pop(scratch);
+
Register scratch2 = esi;
__ movd(xmm2, esi);
« no previous file with comments | « no previous file | src/builtins/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698