mita icon indicating copy to clipboard operation
mita copied to clipboard

Arrayslices with variables are sometimes broken

Open wegendt-bosch opened this issue 6 years ago • 0 comments

If the array generator can't infer the size of the slice bounds, it doesn't always generate a buffer of the correct length (or at all):

fn foo(x: uint32, y: array<int32>) {
	//var y = new array<int32>(size = 10);
 	var z = y[x:2];
}
	// WARNING: Couldn't infer size!
	// var z: array<int32_t>
	array_int32_t z = {
		.data = data_z_1,
		.length = -1
	};

data_z_1 isn't declared beforehand.

wegendt-bosch avatar Apr 25 '18 14:04 wegendt-bosch