You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MethodBodyStreamEncoder.AddMethodBody checks if it is possible to emit Tiny method header, and if it otherwise fits in Tiny, InitLocals flag get effectively ignored.
There is a case where we may need Fat format specifically because we want the InitLocals flag.
That happens if a method otherwise meets requirements of a Tiny format, but has stackalloc in it. If Tiny is used in such case, the caller will stackalloc a piece of nondeterministic garbage.
Overall - it should be up to the caller to decide whether the InitLocals is needed.
AddMethodBody should ensure that the flag is emitted if asked by the caller.
The text was updated successfully, but these errors were encountered:
For the time being, if we need to force the presence of the initlocals bit, we can workaround this by specifying stack size that is too large for a Tiny header.
RelatedTo:dotnet/roslyn#23951
MethodBodyStreamEncoder.AddMethodBody checks if it is possible to emit Tiny method header, and if it otherwise fits in Tiny, InitLocals flag get effectively ignored.
There is a case where we may need Fat format specifically because we want the InitLocals flag.
That happens if a method otherwise meets requirements of a Tiny format, but has
stackalloc
in it. If Tiny is used in such case, the caller willstackalloc
a piece of nondeterministic garbage.Overall - it should be up to the caller to decide whether the InitLocals is needed.
AddMethodBody should ensure that the flag is emitted if asked by the caller.
The text was updated successfully, but these errors were encountered: