Skip to content

Do not merge - memory leak investigation #1761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions Analysis/src/FragmentAutocomplete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1658,21 +1658,22 @@ FragmentAutocompleteResult fragmentAutocomplete(
auto globalScope = (opts && opts->forAutocomplete) ? frontend.globalsForAutocomplete.globalScope.get() : frontend.globals.globalScope.get();
if (FFlag::DebugLogFragmentsFromAutocomplete)
logLuau("Fragment Autocomplete Source Script", src);
TypeArena arenaForFragmentAutocomplete;
unfreeze(tcResult.incrementalModule->internalTypes);
TypeArena arenaForAutocomplete;
auto result = Luau::autocomplete_(
tcResult.incrementalModule,
frontend.builtinTypes,
&arenaForFragmentAutocomplete,
&tcResult.incrementalModule->internalTypes,
tcResult.ancestry,
globalScope,
tcResult.freshScope,
cursorPosition,
frontend.fileResolver,
callback
);

freeze(tcResult.incrementalModule->internalTypes);
reportWaypoint(reporter, FragmentAutocompleteWaypoint::AutocompleteEnd);
return {std::move(tcResult.incrementalModule), tcResult.freshScope.get(), std::move(arenaForFragmentAutocomplete), std::move(result)};
return {std::move(tcResult.incrementalModule), tcResult.freshScope.get(), std::move(arenaForAutocomplete), std::move(result)};
}

} // namespace Luau
2 changes: 1 addition & 1 deletion tests/FragmentAutocomplete.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3410,7 +3410,6 @@ local foo = 8)");
CHECK(*pos == Position{2, 0});
}

#if 0
TEST_CASE_FIXTURE(FragmentAutocompleteBuiltinsFixture, "TypeCorrectLocalReturn_assert")
{
const std::string source = R"()";
Expand All @@ -3434,6 +3433,7 @@ return target(bar)";
);
}

#if 0
TEST_CASE_FIXTURE(FragmentAutocompleteBuiltinsFixture, "TypeCorrectLocalRank_assert")
{
const std::string source = R"()";
Expand Down