Skip to content

Initializing a variable with record/array element #4

@Sh3b0

Description

@Sh3b0

Code to reproduce

routine main() is
	var x : array[5] integer;
	x[1] := 1;
	var y is x[1];
	println y;
	return;
end

Expected behavior

Prints 1

Actual behavior

Prints garbage from memory, most probably the error originates from the local variable intialization code in VariableDeclarartion::visit

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions