Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4486,18 +4486,18 @@ Node* ByteCodeParser::load(

ObjectPropertyCondition ByteCodeParser::presenceConditionIfConsistent(JSObject* knownBase, UniquedStringImpl* uid, PropertyOffset offset, const StructureSet& set)
{
if (set.isEmpty())
return ObjectPropertyCondition();
Structure* structure = knownBase->structure();
unsigned attributes;
PropertyOffset firstOffset = set[0]->getConcurrently(uid, attributes);
if (firstOffset != offset)
PropertyOffset baseOffset = structure->getConcurrently(uid, attributes);
if (offset != baseOffset)
return ObjectPropertyCondition();
for (unsigned i = 1; i < set.size(); ++i) {
unsigned otherAttributes;
PropertyOffset otherOffset = set[i]->getConcurrently(uid, otherAttributes);
if (otherOffset != offset || otherAttributes != attributes)
return ObjectPropertyCondition();
}

// We need to check set contains knownBase's structure because knownBase's GetOwnPropertySlot could normally prevent access
// to this property, for example via a cross-origin restriction check. So unless we've executed this access before we can't assume
// just because knownBase has a property uid at offset we're allowed to access.
if (!set.contains(structure))
return ObjectPropertyCondition();

return ObjectPropertyCondition::presenceWithoutBarrier(knownBase, uid, offset, attributes);
}

Expand Down