.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
392 B

using System;
namespace ICSharpCode.Decompiler.Tests.TestCases.ILPretty
{
public static class StackAllocDuplicateStore
{
public unsafe static int Seq(int a, int b, int c)
{
byte* ptr = stackalloc byte[12];
*(int*)ptr = a;
*(int*)ptr = 99;
((int*)ptr)[1] = b;
((int*)ptr)[2] = c;
Span<int> span = new Span<int>(ptr, 3);
return span[0] + span[1] + span[2];
}
}
}