Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using __VOID as a type in user code should be an error #1348

Open
mhasel opened this issue Oct 24, 2024 · 0 comments
Open

using __VOID as a type in user code should be an error #1348

mhasel opened this issue Oct 24, 2024 · 0 comments

Comments

@mhasel
Copy link
Member

mhasel commented Oct 24, 2024

We currently do not have a validation in place to safeguard against initializing a variable with __VOID. Since the void type does not exist outside of return-types in LLVM, the variable's type is then changed to i32 during codegen.
I think it would make sense to disallow using the type in user code in general, especially seeing as it is prefixed with __.

FUNCTION_BLOCK foo
VAR
    x : __VOID;
END_VAR
END_FUNCTION_BLOCK

...

%foo = type { i32 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant