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

Unified Diff: src/hydrogen.cc

Issue 14352011: Fix missing Smi check in grow mode keyed stores. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use local zone variable. Created 7 years, 8 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 | test/mjsunit/regress/regress-grow-store-smi-check.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index acd2f349c06aad76a73dc5ccb32ee7529d47842d..ec568c307d3a1329ae8a214c2cc71d1fb22d833d 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -1355,7 +1355,11 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess(
elements = BuildCheckForCapacityGrow(object, elements, elements_kind,
length, key, is_js_array);
- checked_key = key;
+ if (!key->type().IsSmi()) {
+ checked_key = AddInstruction(new(zone) HCheckSmiOrInt32(key));
+ } else {
+ checked_key = key;
+ }
} else {
checked_key = AddBoundsCheck(
key, length, ALLOW_SMI_KEY, checked_index_representation);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-grow-store-smi-check.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698