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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 19289009: Fix invalid array length check in TransitionElementsKindStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index 16f4ac019ec47d456fdb81ec7dd2d013354c8cfb..2d703c9068c675f577124ac4351b8c89ca374aa1 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -541,20 +541,20 @@ HValue* CodeStubGraphBuilder<TransitionElementsKindStub>::BuildCodeStub() {
Add<HTrapAllocationMemento>(js_array);
}
- HInstruction* array_length =
- AddLoad(js_array, HObjectAccess::ForArrayLength());
- array_length->set_type(HType::Smi());
+ HInstruction* elements = AddLoadElements(js_array);
+
+ HInstruction* elements_length = AddLoadFixedArrayLength(elements);
IfBuilder if_builder(this);
- if_builder.IfNot<HCompareNumericAndBranch>(array_length,
+ if_builder.IfNot<HCompareNumericAndBranch>(elements_length,
graph()->GetConstant0(),
Token::EQ);
if_builder.Then();
mvstanton 2013/07/16 13:01:07 There might still be an issue here. What if you ar
- HInstruction* elements = AddLoadElements(js_array);
-
- HInstruction* elements_length = AddLoadFixedArrayLength(elements);
+ HInstruction* array_length =
+ AddLoad(js_array, HObjectAccess::ForArrayLength());
+ array_length->set_type(HType::Smi());
BuildGrowElementsCapacity(js_array, elements, from_kind, to_kind,
array_length, elements_length);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698