Skip to content

AnalyzeDataFlow fails for stackalloc array creation initializer expression #60134

@bernd5

Description

@bernd5

Version Used: c95d747

Steps to Reproduce:

Similar to #57572
the following FlowTest code fails:

[Fact]
public void TestDataFlowsStackArrayInit_01()
{
	var analysis = CompileAndAnalyzeDataFlowExpression(@"
class C {
	public void F(int x)
	{
		int a = 1, y = 2;
		var b = stackalloc int[] /*<bind>*/{ a + x + 3 } /*</bind>*/;
		int c = a + 4 + y;
	}
}");
	Assert.Equal("x, a", GetSymbolNamesJoined(analysis.DataFlowsIn));
}

Expected Behavior:
Test should pass.

Actual Behavior:
Test fails.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions