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

Fix edge cases in code parser and stringifier (found by fuzzing) #7886

Merged
merged 4 commits into from
Jun 14, 2019

Commits on Jun 12, 2019

  1. Configuration menu
    Copy the full SHA
    82009ec View commit details
    Browse the repository at this point in the history
  2. Raise SyntaxError rather than IndexError for "\

    - that is, a string (not) terminating with a slash.
    oprypin committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    e2d4985 View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2019

  1. Raise SyntaxError rather than ArgumentError for 9999999...i32

    That is, very large integers *with* the suffix specified.
    It was unconditionally converting the value to uint64, but have to check for the validity of that first.
    Additional check for num_size < 20 fixes it. Such numbers definitely fit into uint64. And this condition fully covers int64, too. gen_check_uint_fits_in_size is not used for uint64 so this is fine.
    oprypin committed Jun 14, 2019
    Configuration menu
    Copy the full SHA
    5ead055 View commit details
    Browse the repository at this point in the history
  2. Fix macro indenting itself when passed to parser to_s

    Parsing/stringifying a macro body would always add two spaces and a newline, but it's supposed to stop changing after one pass.
    oprypin committed Jun 14, 2019
    Configuration menu
    Copy the full SHA
    f595b1c View commit details
    Browse the repository at this point in the history