-
Notifications
You must be signed in to change notification settings - Fork 1
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: Incorrect operator precedence in conditional assembly expressions #13
fix: Incorrect operator precedence in conditional assembly expressions #13
Conversation
auto o = get_operator(symbol); | ||
if (o == ca_expr_ops::UNKNOWN) | ||
return std::monostate(); | ||
bool unary = is_unary(o); | ||
bool binary = is_binary(o); | ||
if (!unary && !binary) | ||
return invalid_by_policy(); |
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.
Do you want to create a static function in ca_common_expr_policy
that will do this set of checks as this part is duplicated 3 times?
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.
the is_unary and is_binary are specialized by the individual policies, so I cannot really do it that way, but I am considering just droping all those functions in favor of one switch(-like) code...
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.
Ok, I see. Other option could be having a base class (e.g. ca_arithmetic_policy_base
) from which the other policies could be derived.
SonarCloud Quality Gate failed. |
eclipse-che4z#259