Skip to content

Rename run to __libfuzzer_sys_run #100

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
Nov 10, 2022
Merged

Rename run to __libfuzzer_sys_run #100

merged 1 commit into from
Nov 10, 2022

Conversation

stormshield-guillaumed
Copy link
Contributor

@stormshield-guillaumed stormshield-guillaumed commented Nov 10, 2022

This reduces chances of function collision. When using the fuzz_target macro, calling run inside the block will call the run function declared inside the macro definition instead of calling the run function defined in the module using fuzz_target. Using the run function of the macro is probably not the intended goal because it leads to a recursive call. Renaming makes it less likely to call __libfuzzer_sys_run by accident.

Closes #99

This reduces chances of function collision. When using the `fuzz_target` macro, calling `run` inside the block will call the `run` function declared inside the macro definition instead of calling the `run` function defined in the module using `fuzz_target`. Using the `run` function of the macro is probably not the intended goal because it leads to a recursive call. Renaming makes it less likely to call `__libfuzzer_sys_run` by accident.
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Thanks!

@fitzgen fitzgen merged commit 55c8e0b into rust-fuzz:master Nov 10, 2022
@stormshield-guillaumed stormshield-guillaumed deleted the name-collision branch November 14, 2022 08:24
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.

fuzz_target macro hygiene
3 participants