Skip to content

[Bug]: Wrong array indexing #956

Closed
Closed
@boriel

Description

@boriel

Contact Details

@oskostenko

Compiler version

v1.18.0-beta9

What happened?

This code works as expected:

sub PrintArray(array() as ubyte)
    for i = lbound(array, 1) to ubound(array, 1)
        print i; ": "; array(i)
    next i
end sub

sub DoSmth
    dim array(1 to 2) as ubyte => {1, 2}
    PrintArray array
end sub

DoSmth

However, when replacing the for line with:

    for i = 1 to 2: REM this is equivalent
...

the results are wrong.

Error and Warning messages

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions