Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Make Unsafe.AsRef inlineable (#14547)
Browse files Browse the repository at this point in the history
The JIT inliner chokes on type mismatch on return. Make the method inlineable by round-tripping the value via local that avoids the type mismatch on return.
  • Loading branch information
jkotas committed Dec 16, 2016
1 parent 72701db commit a0e1d73
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,12 @@
.method public hidebysig static !!T& AsRef<T>(void* source) cil managed aggressiveinlining
{
.custom instance void System.Runtime.Versioning.NonVersionableAttribute::.ctor() = ( 01 00 00 00 )
.locals (int32&)
.maxstack 1
ldarg.0
// Roundtrip via a local to avoid type mismatch on return that the JIT inliner chokes on.
stloc.0
ldloc.0
ret
} // end of method Unsafe::AsRef

Expand Down

0 comments on commit a0e1d73

Please sign in to comment.