Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 22bdfa381e93bbd0150ff72a1a5fb83b6545dbb8..e14c1af6db83bbb880df0768ed2c5fe726cf0a23 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -6771,9 +6771,10 @@ void AccessorInfo::set_property_attributes(PropertyAttributes attributes) { |
bool AccessorInfo::IsCompatibleReceiver(Object* receiver) { |
- Object* function_template = expected_receiver_type(); |
- if (!function_template->IsFunctionTemplateInfo()) return true; |
- return FunctionTemplateInfo::cast(function_template)->IsTemplateFor(receiver); |
+ if (!HasExpectedReceiverType()) return true; |
+ if (!receiver->IsJSObject()) return false; |
+ return FunctionTemplateInfo::cast(expected_receiver_type()) |
+ ->IsTemplateFor(JSObject::cast(receiver)->map()); |
} |