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 the 'ouble' bug #2300

Open
wants to merge 1 commit into
base: NewParser2020
Choose a base branch
from
Open

Commits on Jun 4, 2022

  1. Fix the 'ouble' bug

    This bug occurs when the `pos` variable in `collect_variables()`
    (`collect_variables.cpp:57`) is set one character too far after erasing
    an initializer. This leads to the output getting mangled because of the
    skipped character.
    
    For example, consider the script
    ```
    local double i;
    local double j;
    ```
    
    This will lead to the output being
    ```
    double i;
    ouble j;
    ```
    
    Because after parsing `i`, the `pos` will be on the second character of
    `local`, i.e. it will see `ocal`, and the way the parser is coded makes
    it so that it ends up skipping the first `d` of `double`.
    
    To fix this, just set `pos` to be one character behind when erasing an
    initializer.
    dc03 committed Jun 4, 2022
    Configuration menu
    Copy the full SHA
    65d6a79 View commit details
    Browse the repository at this point in the history