Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't assume objects don't escape in pure helpers.
We can't assume objects don't escape in helpers marked as pure for the following reasons: 1. The helpers may call user code that may make objects escape, e.g., https://github.com/dotnet/coreclr/blob/dotnet/coreclr@c94d8e68222d931d4bb1c4eb9a52b4b056e85f12/src/vm/jithelpers.cpp#L2371 2. The helpers usually protect gc pointers with GCPROTECT_BEGIN() so the pointers are reported as normal pointers to the gc. Pointers to stack-allocated objects need to be reported as interior so they have to be protected with GCPROTECT_BEGININTERIOR(). 3. The helpers may cause these asserts in ValidateInner on stack-allocated objects: https://github.com/dotnet/coreclr/blob/dotnet/coreclr@c94d8e68222d931d4bb1c4eb9a52b4b056e85f12/src/vm/object.cpp#L723 https://github.com/dotnet/coreclr/blob/dotnet/coreclr@c94d8e68222d931d4bb1c4eb9a52b4b056e85f12/src/vm/object.cpp#L730 Commit migrated from dotnet/coreclr@65f8867
- Loading branch information