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

[BUG] Bounds for integer parsing are not correctly checked #105

Closed
orlp opened this issue Aug 24, 2023 · 2 comments
Closed

[BUG] Bounds for integer parsing are not correctly checked #105

orlp opened this issue Aug 24, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@orlp
Copy link

orlp commented Aug 24, 2023

Description

The following

let x: i32 = lexical::parse("9589934592").unwrap();
dbg!(x);

prints 1000000000 instead of giving an error.

Prerequisites

Here are a few things you should provide to help me understand the issue:

  • Rust version: rustc 1.71.0 (8ede3aae2 2023-07-12)
  • lexical version: v6.1.1
  • lexical compilation features used: std, parse-integers

Test case

fn main() {
    let x: Result<i32, _> = lexical::parse("9589934592");
    assert!(x.is_err());
}
@Jefffrey
Copy link

Jefffrey commented Feb 14, 2024

Looks like duplicate of #91

@Alexhuszagh
Copy link
Owner

Closing as a duplicate of #91, a patch should be coming in soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants