Skip to content
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 #12453 fuzzing timeout in getUnsafeFunction() #6020

Merged
merged 13 commits into from
Feb 26, 2024

Conversation

chrchr-github
Copy link
Collaborator

No description provided.

@firewave
Copy link
Collaborator

Need to merge #6018 first and rebase on that to make sure everything it working fine. The timeout was kinda broken.

@chrchr-github
Copy link
Collaborator Author

We could also throw an error in findExpressionStartEndTokens() to be on the safe side.

@firewave
Copy link
Collaborator

We could also throw an error in findExpressionStartEndTokens() to be on the safe side.

Do what you think is appropriate.

One of the fuzzing improvements so we use input closer to real code is that I would discard all cases where we encounter a syntaxError. That would prevent us from finding more potential issues but seems like more reasonable. I already do that for simplecpp.

@chrchr-github chrchr-github marked this pull request as draft February 23, 2024 07:21
@chrchr-github
Copy link
Collaborator Author

chrchr-github commented Feb 23, 2024

void f(double(&)[4]) {}
For &, findExpressionStartEndTokens() returns double as both start and end. Is this expected behavior?

There is an AST issue, ( only has one operand when there is no variable.

Additionally,

class c {
  typedef char foo[4];
  foo _a;
  operator foo &() { return _a; }
};

gets simplified to

2: class c {
3:
4: char _a@var1 [ 4 ] ;
5: operatorchar ( & ( ) ) [ 4 ] { return _a@var1 ; }
6: } ;

which is wrong.

@chrchr-github chrchr-github marked this pull request as ready for review February 24, 2024 21:12
@chrchr-github chrchr-github merged commit eb2dbd3 into danmar:main Feb 26, 2024
64 checks passed
@chrchr-github chrchr-github deleted the chr_Fix12453 branch February 26, 2024 21:57
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