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

Unified Diff: src/heap/heap.cc

Issue 1475823003: [runtime] First step to sanitize regexp literal creation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index c37bab7942ab4e8f5af511ef95173aa280cf16cd..f9b07ca3bf65ed361a720b64243e1f50b57785b0 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3499,9 +3499,10 @@ AllocationResult Heap::CopyJSObject(JSObject* source, AllocationSite* site) {
// Make the clone.
Map* map = source->map();
- // We can only clone normal objects or arrays. Copying anything else
+ // We can only clone regexps, normal objects or arrays. Copying anything else
// will break invariants.
- CHECK(map->instance_type() == JS_OBJECT_TYPE ||
+ CHECK(map->instance_type() == JS_REGEXP_TYPE ||
+ map->instance_type() == JS_OBJECT_TYPE ||
map->instance_type() == JS_ARRAY_TYPE);
int object_size = map->instance_size();

Powered by Google App Engine
This is Rietveld 408576698