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

Unified Diff: src/deoptimizer.cc

Issue 22327008: Fix handle unsafety in Deoptimizer::MaterializeNextHeapObject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index 525f9782d18f2709bf5b5d3a8dd7a39fefcc7957..dc9ffc51186be1c5535297c6adf77f9efbf922b1 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -1675,7 +1675,8 @@ Handle<Object> Deoptimizer::MaterializeNextHeapObject() {
arguments->set_elements(*array);
materialized_objects_->Add(arguments);
for (int i = 0; i < length; ++i) {
- array->set(i, *MaterializeNextValue());
+ Handle<Object> value = MaterializeNextValue();
+ array->set(i, *value);
}
} else {
// Dispatch on the instance type of the object to be materialized.
@@ -1692,10 +1693,13 @@ Handle<Object> Deoptimizer::MaterializeNextHeapObject() {
Handle<JSObject> object =
isolate_->factory()->NewJSObjectFromMap(map, NOT_TENURED, false);
materialized_objects_->Add(object);
- object->set_properties(FixedArray::cast(*MaterializeNextValue()));
- object->set_elements(FixedArray::cast(*MaterializeNextValue()));
+ Handle<Object> properties = MaterializeNextValue();
+ Handle<Object> elements = MaterializeNextValue();
+ object->set_properties(FixedArray::cast(*properties));
+ object->set_elements(FixedArray::cast(*elements));
for (int i = 0; i < length - 3; ++i) {
- object->FastPropertyAtPut(i, *MaterializeNextValue());
+ Handle<Object> value = MaterializeNextValue();
+ object->FastPropertyAtPut(i, *value);
}
break;
}
« 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