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

TypeMemoryLayout + GenericInst struct = Infinity Loop #447

Closed
BadRyuner opened this issue Jun 12, 2023 · 3 comments · Fixed by #448
Closed

TypeMemoryLayout + GenericInst struct = Infinity Loop #447

BadRyuner opened this issue Jun 12, 2023 · 3 comments · Fixed by #448
Labels
Milestone

Comments

@BadRyuner
Copy link

AsmResolver Version

5.3.0

.NET Version

6.0

Operating System

Windows

Describe the Bug

When you create TypeMemoryLayout for GenericInstanceTypeSignature ValueType, you get an infinite loop . Since the CPU load at this time is 100% (for one core), I think that the creation of TypeMemoryLayout goes into an infinite loop.

How To Reproduce

GenericInstanceTypeSignature gist = ...; // In my case: List<!0>.Enumerator
var size = gist.GetImpliedMemoryLayout(false).Size; // infinity loop

Also if you change the parameters and pass List.Enumerator, it will also die.

Expected Behavior

Get the size of the entire GenericTypeInstance.

Actual Behavior

Infinite Loop.

Additional Context

No response

@Washi1337
Copy link
Owner

I am not sure if I fully reproduced your issue, but a potential fix is in #448. Could you please test if this indeed fixes your issue?

@Washi1337 Washi1337 linked a pull request Jun 12, 2023 that will close this issue
@BadRyuner
Copy link
Author

It doesn't loop anymore.

@Washi1337
Copy link
Owner

Perfect, it will be part of 5.4.0 then 👍

@Washi1337 Washi1337 added this to the 5.4.0 milestone Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants