transplant game engine fix for memory safety issues in normalization into OSS changes

This commit is contained in:
Vighnesh 2024-04-05 13:27:37 -07:00
parent 0f1973954c
commit 5aa6d99340

View File

@ -2631,6 +2631,9 @@ struct TypeChecker2
for (const auto& [ty, _negations] : norm->classes.classes) for (const auto& [ty, _negations] : norm->classes.classes)
{ {
fetch(ty); fetch(ty);
if (!normValid)
break;
} }
} }
@ -2644,9 +2647,16 @@ struct TypeChecker2
fetch(builtinTypes->stringType); fetch(builtinTypes->stringType);
if (normValid) if (normValid)
fetch(norm->threads); fetch(norm->threads);
for (TypeId ty : norm->tables)
if (normValid) if (normValid)
{
for (TypeId ty : norm->tables)
{
fetch(ty); fetch(ty);
if (!normValid)
break;
}
}
if (normValid && norm->functions.isTop) if (normValid && norm->functions.isTop)
fetch(builtinTypes->functionType); fetch(builtinTypes->functionType);
else if (normValid && !norm->functions.isNever()) else if (normValid && !norm->functions.isNever())
@ -2672,6 +2682,9 @@ struct TypeChecker2
} }
else else
fetch(tyvar); fetch(tyvar);
if (!normValid)
break;
} }
} }