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

Improve parsing of bracketed expressions #109

Merged
merged 3 commits into from
Sep 4, 2024

Commits on Aug 16, 2024

  1. Fix out-of-bounds write.

    If MBS conversion fails while parsing a bracketed expression, we'd end
    up writing '\0' to `buf[-1]`.  Check the result of the conversion.
    
    While here, rewrite `tre_parse_bracket_items()` to return immediately
    on error, instead of lazily checking the status later.
    
    This fixes laurikari#51.
    dag-erling committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    36a8bb0 View commit details
    Browse the repository at this point in the history
  2. Reduce nesting in tre_parse_bracket_items().

    Since we now return immediately on error, we don't need an if-else chain.
    This allows us to unindent a large swath of code.
    dag-erling committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    87772ce View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2024

  1. Fix minor type issue.

    I meant to include this in a0cafd4 but forgot.
    dag-erling committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    4ac2cd6 View commit details
    Browse the repository at this point in the history