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

List.compare_length_with mishandles negative numbers / overflow #7513

Closed
vicuna opened this issue Apr 4, 2017 · 2 comments
Closed

List.compare_length_with mishandles negative numbers / overflow #7513

vicuna opened this issue Apr 4, 2017 · 2 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Apr 4, 2017

Original bug ID: 7513
Reporter: @yallop
Assigned to: @lefessan
Status: resolved (set by @mshinwell on 2017-05-16T20:00:26Z)
Resolution: fixed
Priority: normal
Severity: minor
Category: standard library

Bug description

List.compare_length_with [] min_int;;

  • : int = 1

List.compare_length_with [1] min_int;;

  • : int = -1
@vicuna
Copy link
Author

vicuna commented Apr 5, 2017

Comment author: @lefessan

I submitted the following PR:
#1136

You might want to review it to check that it does not introduce another bug.

@vicuna
Copy link
Author

vicuna commented May 16, 2017

Comment author: @mshinwell

#1136 has been merged to fix this issue.

@vicuna vicuna closed this as completed May 16, 2017
@vicuna vicuna added the stdlib label Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
lefessan added a commit to lefessan/ocaml that referenced this issue Jun 22, 2020
Add tests List.compare_lengths and List.compare_length_with in tests/lib-list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants