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

uint64_t overflows cause false positives in _qf_multi_merge #13

Open
fazalmajid opened this issue Jun 14, 2023 · 0 comments
Open

uint64_t overflows cause false positives in _qf_multi_merge #13

fazalmajid opened this issue Jun 14, 2023 · 0 comments

Comments

@fazalmajid
Copy link

I was encountering spurious errors "Merging non compatible filters" in _qf_multi_merge with key_bits = 64 and quotient = 20 bits. I traced it to a 64-bit overflow, as qf->metadata->range is 128-bit. The following change fixes it and it still passes the ctest --verbose unit test suite.

diff --git a/src/gqf.cpp b/src/gqf.cpp
index 606a5e9..3ef9c81 100644
--- a/src/gqf.cpp
+++ b/src/gqf.cpp
@@ -2808,7 +2808,7 @@ void _qf_multi_merge(QF *qf_arr[],int nqf, QF *qfr,
                                                         ))
 {
        int i;
-       uint64_t range=qf_arr[0]->metadata->range;
+       __uint128_t range=qf_arr[0]->metadata->range;
        for (i=1; i<nqf; i++) {
                if(qf_arr[i]->metadata->range!=range)
                {
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

1 participant