facebook / facebook/flow

Octal and binary numbers > 2^63-1 crash the parser

Open
#3,674 0 comments 0 reactions 0 assignees View on GitHub
Accepting PRs Crash Effort: easy parsing
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

we're using `Int64.of_string` to parse octal and binary numbers (e.g. `0o1234` or `0b10101`). `Int64.of_string` throws when called with a number larger than `Int64.max_int` (2^63-1).

Instead, I think we can just use `string_of_float`. It seems to support `0b` and `0o`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.