Skip to content

[FuzzMutate] Prevent UB caused by parameter ABI attributes #139737

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mgcarrasco
Copy link
Contributor

This PR prevents the IRMutator from incorrectly calling functions that have ABI attributes, otherwise the mutations introduce UB.

We make those cases unsupported as it happens now for functions accepting metadata or token types.
@jmmartinez jmmartinez requested a review from DataCorrupted May 13, 2025 14:17
@@ -143,6 +143,9 @@ class InsertFunctionStrategy : public IRMutationStrategy {

using IRMutationStrategy::mutate;
void mutate(BasicBlock &BB, RandomIRBuilder &IB) override;

private:
bool isUnsupportedFunction(Function *F);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: This function does not concern InsertFunctionStrategy a lot. Maybe better to declare it in IRMutator.cpp as static bool isUnsupportedFunction. Also better to comment all unsupported reason on top of the definition.

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