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

Bugfix #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Bugfix #1

wants to merge 2 commits into from

Conversation

DapperX
Copy link
Contributor

@DapperX DapperX commented Jul 24, 2022

Uniform distribution
Invoking uniform_input_unsorted(n,4294967295) resulted in calling std::uniform_int_distribution<int>(1,-1), which is an undefined behavior. Fixed it by changing the type to std::uniform_int_distribution<size_t>.

--small flag
parser.add_argument('--small', action="store_false", ...) assigned a default value to args.small so the scripts would always use the small datasets regardless of --small flag. Besides, store_false seemed to have the opposite behavior to the literal meaning of this flag.

The default template parameter of `uniform_int_distribution` is int.
As the constructor uses the same type, the passed argument `window`
will be implicitly narrowed down and get overflow when its value is
greater than INT_MAX. In that case, the random number generator has UB.
@DapperX DapperX requested a review from ldhulipala July 24, 2022 05:04
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.

1 participant