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

Byte string comparison bug #6

Open
thisbefruit opened this issue Jun 7, 2022 · 1 comment
Open

Byte string comparison bug #6

thisbefruit opened this issue Jun 7, 2022 · 1 comment

Comments

@thisbefruit
Copy link

Comparing two byte strings is buggy:

Incorrect answer when first string is a substring of the second:

melorun> "mel" == "melo"
1

melorun> "mel" == "melorrrrrrrrrrr"
1

melorun> x"deadbeef" == x"deadbeef02"
1

Also this:

melorun> x"deadbeef02" == x"deadbeef"
1

Fails when first string is longer than second, for both ascii and hex:

melorun> "meloooo" == "mel"
execution failed

melorun> x"deadbeef0234" == x"deadbeef"
execution failed
@nullchinchilla
Copy link
Member

This is temporarily fixed by restricting equality comparison to integers. A complete solution would require a better formalization of values of what types can even be compared with == (in short, types that have statically known sizes, or finite unions of such types)

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

No branches or pull requests

2 participants