Skip to content

rust: fix bug where unsafe expressions didn't require unsafe block. #391

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 26, 2021

Conversation

wedsonaf
Copy link

In the init_with_lockdep macro, the macros were evaluated inside an
unsafe block, so they could contain unsafe operations without requiring
an explicit unsafe block on the call site.

Fixed by evaluating $obj and $name outside an unsafe block.

Reported-by: Sven Van Asbroeck [email protected]
Signed-off-by: Wedson Almeida Filho [email protected]

In the `init_with_lockdep` macro, the macros were evaluated inside an
unsafe block, so they could contain unsafe operations without requiring
an explicit unsafe block on the call site.

Fixed by evaluating `$obj` and `$name` outside an unsafe block.

Reported-by: Sven Van Asbroeck <[email protected]>
Signed-off-by: Wedson Almeida Filho <[email protected]>
@ksquirrel
Copy link
Member

Review of b8a334a9a08d:

  • ✔️ Commit b8a334a: Looks fine!

@ojeda
Copy link
Member

ojeda commented Jun 26, 2021

LGTM

@ojeda ojeda merged commit ac48d0a into Rust-for-Linux:rust Jun 26, 2021
@wedsonaf wedsonaf deleted the unsafe-init branch June 26, 2021 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants