-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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 null dereference in using for directive when operator name is empty #14135
Conversation
facbc74
to
9cf6479
Compare
@@ -0,0 +1,3 @@ | |||
using {f as ''} for uint; |
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.
I'd cover additional cases that Kamil mentioned in the original issue. Also, this error kinda looks a bit weird when an empty string is returned; perhaps we should consider a special case for this scenario (not necessarily in this PR, since I'd assume that a segfault takes precedence).
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.
Yes, I will add tests for those too.
I had the thought to make a different message for the case of the empty string, but stopped myself until we decide it is really needed. Also, I agree that it is probably better to (eventually) do it in another PR.
b44bd8c
to
e019a59
Compare
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.
@cameel for final review.
test/libsolidity/syntaxTests/operators/userDefined/using_for_empty_operator_name.sol
Outdated
Show resolved
Hide resolved
test/libsolidity/syntaxTests/operators/userDefined/using_for_empty_operator_name.sol
Outdated
Show resolved
Hide resolved
e019a59
to
5a24be3
Compare
5a24be3
to
64f57ac
Compare
Addressed all comments and rebased. |
fix #14016 .