-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fix ICE from null character #17472
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
Fix ICE from null character #17472
Conversation
…port_name value strings.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon. |
@@ -2670,6 +2670,15 @@ fn exported_name(ccx: &CrateContext, id: ast::NodeId, | |||
} | |||
} | |||
|
|||
fn contains_null(s: &str) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this just be replaced with .bytes().contains(0)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like the iterator implements any contains method. I did change it to use any() though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaseyc It doesn't look like you pushed this revision to the PR. Once you do, I think it's ready to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm waiting for the change to finish a pass through make check, just to be thorough.
Add checks for null bytes in the value strings for the export_name and link_section attributes, reporting an error if any are found, before calling with_c_str on them. Fixes #16478
rust-lang#17470 - run unit tests at the crate level not workspace For rust-lang/rust-analyzer#17470 Use the test path to identify a package in the workspace and run the unit test there instead of at the workspace.
rust-lang#17470 - run unit tests at the crate level not workspace For rust-lang/rust-analyzer#17470 Use the test path to identify a package in the workspace and run the unit test there instead of at the workspace.
Add checks for null bytes in the value strings for the export_name and link_section attributes, reporting an error if any are found, before calling with_c_str on them.
Fixes #16478