Skip to content
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

check if generic type assembly has been added to set #1438

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

hemirunner426
Copy link
Contributor

Check the holding set to see if the type assembly has already been added to avoid the stack overflow.
#1437

Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.05%. Comparing base (d2ed00a) to head (1b3b07d).
Report is 7 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1438      +/-   ##
===========================================
+ Coverage    79.03%   79.05%   +0.01%     
===========================================
  Files          200      200              
  Lines         5682     5685       +3     
  Branches      1143     1144       +1     
===========================================
+ Hits          4491     4494       +3     
  Misses         696      696              
  Partials       495      495              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -68,6 +68,11 @@ private static void PopulateAllReferencedAssemblies(Type inputType, HashSet<Asse

foreach (var genericArgumentType in genericArguments)
{
if (holdingSet.Any(a => a.DefinedTypes.Contains(genericArgumentType)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For performance reasons, if this only overflows in a tight loop where we're self-referencing, can we please pass into PopulateAllReferencedAssemblies a "HashSet activeWorkingSet" and insert there each time we add a type, then check that active working set instead? This should result in a simple O(1) check for the type having already been seen in this tree.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing. Changes have been committed.

Copy link
Member

@tillig tillig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for helping out!

@tillig tillig merged commit 172f06a into autofac:develop Dec 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants