Skip to content

Parse out of range number literals correctly #114

Description

@Lythenas

Out of range number literals (at least inegers, not sure about floats) will truncate to -1.

Note that I'm talking about numbers bigger than 0xffffffffffffffff. This will parse to -1 (which is correct). And adding more fs should not change the value. In this case it does not because if the value is out of range it will return ULONG_MAX which is also -1 after the cast. But e.g. 0xffffffffffffff0c is -244 (which is correct) but adding more fs will change the value to -1 instead of keeping it -244.

I think none of the C/C++ parsing functions do what we want here and we have to implement it ourselves.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parserArea: ParserC-bugSomething isn't workingP-lowPriority: Low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions