Reject struct promotion of parameters when -GS checks are enabled#17329
Conversation
|
Introduced with #16220 |
|
@AndyAyersMS PTAL |
|
I will try to work up a repro case for this issue. |
|
Can you verify we still get the same codegen for the span-stackalloc cases in #16197? Seeing running diffs would be valuable. Likely there should be no diffs in core and framework assemblies. Perhaps a few in tests if we have some IL tests that have unsafe value classes. |
as we could introduce shadow copies of them. Add new test case: GitHub_17329.cs
c4fff19 to
6b07baf
Compare
|
I saw a handful of diffs on the desktop. ' |
|
One such diff occurs in where local 4 is an unsafe-buffer That struct is a MetadataEnumResult which is defined: So it looks like there are two ways to mark a struct as being an unsafe-buffer Either use the full Attribute name like I did in my test case: or by simply using the C# keyword unsafe in your struct definition as is done for MetadataEnumResult: |
This causes bad codegen when we introduce shadow copies for them.