Skip to content

Commit d2f8c41

Browse files
committed
[MERGE #5800 @pleath] Force new type check when object ptr copy prop creates a mismatch
Merge pull request #5800 from pleath:mismatch We used to disable objtypespec altogether for the given object pointer in such a case, but that's no longer necessary now that we don't share inline caches. Failure to objtypespec was exposed by a cross-site function type-sharing unit test.
2 parents 573adb7 + 2c91a28 commit d2f8c41

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/Backend/GlobOptFields.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,13 @@ GlobOpt::CopyPropPropertySymObj(IR::SymOpnd *symOpnd, IR::Instr *instr)
18511851
bool shouldOptimize = CompareCurrentTypesWithExpectedTypes(newValueInfo, propertySymOpnd);
18521852
if (!shouldOptimize)
18531853
{
1854-
propertySymOpnd->SetTypeCheckSeqCandidate(false);
1854+
// Force a new type check here. We used to disable optimization for this symbol, but that's
1855+
// no longer necessary now that inline caches are not shared.
1856+
BVSparse<JitArenaAllocator> *liveFields = this->currentBlock->globOptData.liveFields;
1857+
if (liveFields)
1858+
{
1859+
liveFields->Clear(newTypeSym->m_id);
1860+
}
18551861
}
18561862
}
18571863

0 commit comments

Comments
 (0)