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

Align C++ and Python versions of hasMasksSet do not align #27248

Closed
mhazley opened this issue Jun 14, 2023 · 0 comments · Fixed by #27253
Closed

Align C++ and Python versions of hasMasksSet do not align #27248

mhazley opened this issue Jun 14, 2023 · 0 comments · Fixed by #27253
Labels
bug Something isn't working testing

Comments

@mhazley
Copy link
Contributor

mhazley commented Jun 14, 2023

What is the hasMasksSet constraint supposed to do with something like hasMasksSet: [0x03]?

The C++ implementation does:

        if (current & expected)
        {
            return true;
        }

while the python implementation does:

      (value & mask) == mask

So the C++ is testing "any of the bits in the mask is set", while the Python tests "all of the bits in the mask are set".

The C++ implementation seems more useful since the Python behavior can be gotten already with hasMasksSet: [0x01, 0x02], no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant