Skip to content

Memory checks for arrays #5

@Sh3b0

Description

@Sh3b0

Example code

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

Expected behavor

Runtime errors as we access invalid indexes (btw, C+ arrays are 1-indexed)

Actual behavior

Prints -1, 0, 6
Although seems cool, it shouldn't be like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions