Beef
Beef copied to clipboard
Stack overflow crash due to stack-allocation in loop condition
The code below is causing a stack overflow crash, it appears that the delegate allocated in the loop condition is being unnecessarily kept on the stack during all loop interactions.
List<int> TestList = scope .();
while (TestList.FindIndex(scope (i) => i > 100000) == -1)
{
TestList.Add(TestList.Count);
}
Tested with: https://github.com/beefytech/Beef/commit/4c656529556ef2e7f8398be1b6c1d803dea512a6