-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix gc hole in Frozen.cs #76868
Fix gc hole in Frozen.cs #76868
Conversation
Tagging subscribers to this area: @dotnet/gc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6cf8a07
to
d6f1257
Compare
src/tests/GC/API/Frozen/Frozen.cs
Outdated
ref Unsafe.As<RawData>(obj).Data; | ||
|
||
internal static unsafe IntPtr GetMethodTablePointer(object obj) => | ||
(IntPtr)Unsafe.Add(ref Unsafe.As<byte, IntPtr>(ref obj.GetRawData()), -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes that offset 0 is a valid byref. It happens to be true in CoreCLR today, but it is not a safe assumption to make.
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix
Fixes #76856
Confirmed that the test stopped crashing after this change.