PLC-lang / rusty

Structured Text Parser and LLVM Frontend
GNU Lesser General Public License v3.0
223 stars 53 forks source link

Stack overflow when trying to initialize a pointer of undefined type with `REF` or `ADR` #1335

Closed mhasel closed 1 month ago

mhasel commented 1 month ago

Describe the bug When trying to initialize a member variable of an undefined type with a REF call on the right hand side, the compiler will overflow it's stack while trying to validate that the pointer types match.

To Reproduce

PROGRAM mainProg
VAR
    refToUndefinedType: REF_TO Ty := REF(whatsInHereDoesntMatter);
END_VAR
END_PROGRAM

Expected behavior A diagnostic to tell the user that the declared type or reference could not be resolved.

Additional context This happens in rusty::typesystem::is_same_type_class.

mhasel commented 1 month ago

resolved with #1341