Skip to content

inform compiler about local variable definedness #58778

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

Merged
merged 1 commit into from
Jun 20, 2025
Merged

Conversation

aviatesk
Copy link
Member

JET's new analysis pass now detects local variables that may be undefined, which has revealed such issues in several functions within Base (#58762).

This commit addresses local variables whose definedness the compiler cannot properly determine, primarily in functions reachable from JET's test suite. No functional changes are made.

@aviatesk aviatesk added the backport 1.12 Change should be backported to release-1.12 label Jun 19, 2025
@aviatesk aviatesk force-pushed the avi/local-var-undef branch from 1f1151e to f2b3886 Compare June 19, 2025 13:59
@@ -208,6 +204,8 @@ function multiq_deletemin()
end
end

@assert @isdefined(rn1) "Assertion to tell the compiler about the definedness of this variable"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a comment instead of a string?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but I'm not sure what to put for the assertion string. Any idea?

JET's new analysis pass now detects local variables that may be
undefined, which has revealed such issues in several functions within
Base (#58762).

This commit addresses local variables whose definedness the compiler
cannot properly determine, primarily in functions reachable from JET's
test suite. No functional changes are made.
@aviatesk aviatesk force-pushed the avi/local-var-undef branch from f2b3886 to 60b0813 Compare June 19, 2025 17:56
@aviatesk
Copy link
Member Author

I'll proceed with this for now.
If you have any suggestions for corrections to error messages or other issues, please let me know even after merging.

@aviatesk aviatesk merged commit d47d4ec into master Jun 20, 2025
7 checks passed
@aviatesk aviatesk deleted the avi/local-var-undef branch June 20, 2025 05:40
aviatesk added a commit that referenced this pull request Jun 20, 2025
JET's new analysis pass now detects local variables that may be
undefined, which has revealed such issues in several functions within
Base (#58762).

This commit addresses local variables whose definedness the compiler
cannot properly determine, primarily in functions reachable from JET's
test suite. No functional changes are made.
@aviatesk aviatesk removed the backport 1.12 Change should be backported to release-1.12 label Jun 20, 2025
@aviatesk aviatesk mentioned this pull request Jun 20, 2025
40 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants