Commit f353ff66 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Harden Runtime_LiveEditCheckAndDropActivations against unsafe args.

R=jarin@chromium.org
BUG=390925
LOG=N

Review URL: https://codereview.chromium.org/362983004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22169 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 7a8a44aa
...@@ -1957,7 +1957,7 @@ Handle<JSArray> LiveEdit::CheckAndDropActivations( ...@@ -1957,7 +1957,7 @@ Handle<JSArray> LiveEdit::CheckAndDropActivations(
Isolate* isolate = shared_info_array->GetIsolate(); Isolate* isolate = shared_info_array->GetIsolate();
int len = GetArrayLength(shared_info_array); int len = GetArrayLength(shared_info_array);
CHECK(shared_info_array->HasFastElements()); ASSERT(shared_info_array->HasFastElements());
Handle<FixedArray> shared_info_array_elements( Handle<FixedArray> shared_info_array_elements(
FixedArray::cast(shared_info_array->elements())); FixedArray::cast(shared_info_array->elements()));
......
...@@ -13503,6 +13503,7 @@ RUNTIME_FUNCTION(Runtime_LiveEditCheckAndDropActivations) { ...@@ -13503,6 +13503,7 @@ RUNTIME_FUNCTION(Runtime_LiveEditCheckAndDropActivations) {
CONVERT_ARG_HANDLE_CHECKED(JSArray, shared_array, 0); CONVERT_ARG_HANDLE_CHECKED(JSArray, shared_array, 0);
CONVERT_BOOLEAN_ARG_CHECKED(do_drop, 1); CONVERT_BOOLEAN_ARG_CHECKED(do_drop, 1);
RUNTIME_ASSERT(shared_array->length()->IsSmi()); RUNTIME_ASSERT(shared_array->length()->IsSmi());
RUNTIME_ASSERT(shared_array->HasFastElements())
int array_length = Smi::cast(shared_array->length())->value(); int array_length = Smi::cast(shared_array->length())->value();
for (int i = 0; i < array_length; i++) { for (int i = 0; i < array_length; i++) {
Handle<Object> element = Handle<Object> element =
......
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
var a = new Array();
Object.freeze(a);
assertThrows(function() { %LiveEditCheckAndDropActivations(a, true); });
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