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

C#: Correctly parse operator names in MaD #14678

Merged
merged 4 commits into from
Nov 7, 2023

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Nov 3, 2023

We were incorrectly using the operator name (e.g. +) instead of the operator function name (e.g. op_Addition).

@github-actions github-actions bot added the C# label Nov 3, 2023
@hvitved hvitved force-pushed the csharp/mad-operator-fix branch 2 times, most recently from 0ddfa1d to 4a4b924 Compare November 5, 2023 19:26
@hvitved hvitved force-pushed the csharp/mad-operator-fix branch from 4a4b924 to 3e3ea51 Compare November 5, 2023 19:58
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Nov 6, 2023
@hvitved hvitved marked this pull request as ready for review November 6, 2023 10:16
@hvitved hvitved requested a review from a team as a code owner November 6, 2023 10:16
/**
* Holds if a source model exists for the given parameters.
*/
extensible predicate sourceModel(
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we keep this in the ExternalFlowExtensions file instead - to make sure this is streamlined with other languages (for java - the model related predicates in ExternalFlow are not just aliases)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That means those predicates are exposed; do we really want/need that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe then move the entire ExternalFlowExtensions file as well (also for Java)?

pragma[nomagic]
private predicate callableSpecInfo(Callable c, string namespace, string type, string name) {
c.getDeclaringType().hasQualifiedName(namespace, type) and
c.getName() = name
hasName(c, name)
Copy link
Contributor

Choose a reason for hiding this comment

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

🙀 So was it the case, that even though the models existed they were not applied correctly to the operator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@hvitved hvitved merged commit b2512eb into github:main Nov 7, 2023
17 checks passed
@hvitved hvitved deleted the csharp/mad-operator-fix branch November 7, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants