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

Unified Diff: runtime/vm/intrinsifier_x64.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 | « runtime/vm/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_x64.cc
===================================================================
--- runtime/vm/intrinsifier_x64.cc (revision 11321)
+++ runtime/vm/intrinsifier_x64.cc (working copy)
@@ -44,6 +44,11 @@
__ j(NOT_ZERO, &fall_through);
__ cmpq(RDI, Immediate(0));
__ j(LESS, &fall_through);
+ // Check for maximum allowed length.
+ const Immediate max_len =
+ Immediate(reinterpret_cast<int64_t>(Smi::New(Array::kMaxElements)));
+ __ cmpq(RDI, max_len);
+ __ j(GREATER, &fall_through);
intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1;
__ leaq(RDI, Address(RDI, TIMES_4, fixed_size)); // RDI is a Smi.
ASSERT(kSmiTagShift == 1);
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698