Skip to content

Invalid double-deref on a pointer ends in a panic in codegen #1448

Open
@mhasel

Description

@mhasel

Describe the bug
If I have a pointer with one level of indirection and try to dereference it twice, the compilation ends in a panic in inkwell.

To Reproduce

      FUNCTION main : DINT 
        VAR
            ref: REF_TO INT;
        END_VAR
            ref^^; // invalid double deref on pointer
        END_FUNCTION

Expected behavior
A diagnostic that a double deref is invalid in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcodegenvalidationcandidate for syntactic or semantic validation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions