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

Unified Diff: runtime/vm/intrinsifier_ia32.cc

Issue 10874061: Fix intrinsified allocation of arrays which cuased crash on ia32: do not allow allocation of arrays… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_ia32.cc
===================================================================
--- runtime/vm/intrinsifier_ia32.cc (revision 11321)
+++ runtime/vm/intrinsifier_ia32.cc (working copy)
@@ -45,6 +45,11 @@
__ j(NOT_ZERO, &fall_through);
__ cmpl(EDI, Immediate(0));
__ j(LESS, &fall_through);
+ // Check for maximum allowed length.
+ const Immediate max_len =
+ Immediate(reinterpret_cast<int32_t>(Smi::New(Array::kMaxElements)));
+ __ cmpl(EDI, max_len);
+ __ j(GREATER, &fall_through);
intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1;
__ leal(EDI, Address(EDI, TIMES_2, fixed_size)); // EDI is a Smi.
ASSERT(kSmiTagShift == 1);
« no previous file with comments | « no previous file | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698