ClusterFuzz fix: %NormalizeElements shouldn't process the global proxy.
authormvstanton <mvstanton@chromium.org>
Mon, 19 Jan 2015 09:31:02 +0000 (01:31 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 19 Jan 2015 09:31:19 +0000 (09:31 +0000)
BUG=449070
R=yangguo@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#26126}

src/runtime/runtime-array.cc
test/mjsunit/regress/regress-449070.js [new file with mode: 0644]

index a017236..a69d8c8 100644 (file)
@@ -1170,7 +1170,8 @@ RUNTIME_FUNCTION(Runtime_NormalizeElements) {
   DCHECK(args.length() == 1);
   CONVERT_ARG_HANDLE_CHECKED(JSObject, array, 0);
   RUNTIME_ASSERT(!array->HasExternalArrayElements() &&
-                 !array->HasFixedTypedArrayElements());
+                 !array->HasFixedTypedArrayElements() &&
+                 !array->IsJSGlobalProxy());
   JSObject::NormalizeElements(array);
   return *array;
 }
diff --git a/test/mjsunit/regress/regress-449070.js b/test/mjsunit/regress/regress-449070.js
new file mode 100644 (file)
index 0000000..7a0f0a8
--- /dev/null
@@ -0,0 +1,10 @@
+// Copyright 2015 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
+
+try {
+  %NormalizeElements(this);
+} catch(e) {
+}