Bug 1903041: Use a linear search in more situations. a=dmeehan

Original Revision: https://phabricator.services.mozilla.com/D214989

Differential Revision: https://phabricator.services.mozilla.com/D216607
This commit is contained in:
Ben Visness 2024-07-16 14:29:07 +00:00
parent eeca4f8483
commit 61c4e4fdf9

View file

@ -842,11 +842,12 @@ class TypeDef {
return true;
}
const SuperTypeVector* subSTV = subTypeDef->superTypeVector();
const SuperTypeVector* superSTV = superTypeDef->superTypeVector();
// During construction of a recursion group, the super type vector may not
// have been computed yet, in which case we need to fall back to a linear
// search.
if (!subSTV) {
if (!subSTV || !superSTV) {
while (subTypeDef) {
if (subTypeDef == superTypeDef) {
return true;
@ -868,7 +869,6 @@ class TypeDef {
return false;
}
const SuperTypeVector* superSTV = superTypeDef->superTypeVector();
MOZ_ASSERT(superSTV);
MOZ_ASSERT(superSTV->typeDef() == superTypeDef);