Skip to content

Fix invalid comparison #157

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

Merged
merged 1 commit into from
Feb 20, 2018
Merged

Conversation

dinikolop
Copy link
Contributor

This fixes #156

There happened to be an edge case where a long long variable was getting a negative value (-1) and then it was compared to a size_t variable.

When there is an arithmetic comparison between size_t and and an (signed) long long operator, then the latter transforms into an unsigned version. In this issue, hasNext() was comparing a positive number x (of type size_t) with -1 : return x <= -1 , but -1 was converted to size_t and consequently in a very large positive number.

Added an extra expression which checks if the variable is negative.

@LaurensRietveld LaurensRietveld merged commit 23fcd28 into rdfhdt:develop Feb 20, 2018
@LaurensRietveld
Copy link
Member

👍 , thanks!

@dinikolop dinikolop deleted the fix-search-bug branch October 31, 2018 12:33
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

Successfully merging this pull request may close these issues.

error and bad results of a simple triple pattern search
2 participants