Commit 26569a47 authored by ssanfilippo's avatar ssanfilippo Committed by Commit bot

[Interpreter] Fix getIgnitionDispatchCounters crash with modified Object prototype.

Changes to the Object prototype may cause getIgnitionDispatchCounters()
to fail when building the counters table object. Using DefineOwnProperty
instead of Set solves the issue by ignoring the prototype chain.

BUG=chromium:613567
LOG=N

Review-Url: https://codereview.chromium.org/2000203002
Cr-Commit-Position: refs/heads/master@{#36447}
parent 6eb242ee
...@@ -250,7 +250,8 @@ Local<v8::Object> Interpreter::GetDispatchCountersObject() { ...@@ -250,7 +250,8 @@ Local<v8::Object> Interpreter::GetDispatchCountersObject() {
NewStringType::kNormal) NewStringType::kNormal)
.ToLocalChecked(); .ToLocalChecked();
Local<v8::Number> counter_object = v8::Number::New(isolate, counter); Local<v8::Number> counter_object = v8::Number::New(isolate, counter);
CHECK(counters_row->Set(context, to_name_object, counter_object) CHECK(counters_row
->DefineOwnProperty(context, to_name_object, counter_object)
.IsJust()); .IsJust());
} }
} }
...@@ -261,7 +262,9 @@ Local<v8::Object> Interpreter::GetDispatchCountersObject() { ...@@ -261,7 +262,9 @@ Local<v8::Object> Interpreter::GetDispatchCountersObject() {
NewStringType::kNormal) NewStringType::kNormal)
.ToLocalChecked(); .ToLocalChecked();
CHECK(counters_map->Set(context, from_name_object, counters_row).IsJust()); CHECK(
counters_map->DefineOwnProperty(context, from_name_object, counters_row)
.IsJust());
} }
return counters_map; return counters_map;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment