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

Add validation for invalid call parameter count #1027

Closed
mhasel opened this issue Nov 23, 2023 · 0 comments · Fixed by #1233
Closed

Add validation for invalid call parameter count #1027

mhasel opened this issue Nov 23, 2023 · 0 comments · Fixed by #1233
Labels
medium-priority validation candidate for syntactic or semantic validation

Comments

@mhasel
Copy link
Member

mhasel commented Nov 23, 2023

Is your feature request related to a problem? Please describe.
Currently we are not validating the amount of passed parameters to function calls. Calls with too many/too few parameters will fail with an error during codegen. Example:

FUNCTION foo : DINT
        VAR_INPUT
            x1 : DINT;
            x2 : REAL;
        END_VAR
END_FUNCTION

FUNCTION main : DINT
        VAR
            x1 : DINT;
            x2 : REAL;
        END_VAR
            foo(x1);
            foo(x1, x2, x1, x2);
END_FUNCTION

Describe the solution you'd like
We should add a validation to check for invalid param count.

@mhasel mhasel added the validation candidate for syntactic or semantic validation label Nov 23, 2023
@volsa volsa closed this as completed in 8d0e9e5 Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium-priority validation candidate for syntactic or semantic validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants