Beef
Beef copied to clipboard
[Bug] Static append can overlay other fields in memory
Creating a static append List<T> field with an initial capacity, overlays the memory for the static fields that follows.
It works fine with instance fields.
Tested in latest nightly.
using System;
using System.Collections;
namespace Playground;
class Program
{
static append List<int> list = .(1024);
static int value = 1;
public static int Main(String[] args)
{
list.Add(2);
System.Diagnostics.Debug.WriteLine($"{value}"); // Writes 2, expected 1
return 0;
}
}