Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 9d17f1f8bd4e6f9275c00b106dee86174b2edae1..f3090011809f2380ddae0249ef8919fd26b604ba 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -10824,7 +10824,9 @@ void Code::FindAndReplace(const FindAndReplacePattern& pattern) { |
RelocInfo* info = it.rinfo(); |
Object* object = info->target_object(); |
if (object->IsHeapObject()) { |
- DCHECK(!object->IsWeakCell()); |
+ if (object->IsWeakCell()) { |
+ object = HeapObject::cast(WeakCell::cast(object)->value()); |
+ } |
Map* map = HeapObject::cast(object)->map(); |
if (map == *pattern.find_[current_pattern]) { |
info->set_target_object(*pattern.replace_[current_pattern]); |