-
-
Notifications
You must be signed in to change notification settings - Fork 822
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
'IndexError: list index out of range' raised calling vyper.compiler.compile_code with 54 double quotes #2258
Labels
bug
Bug that shouldn't change language semantics when fixed.
Comments
If helpful, here's what seems to be clearly a variant (again, exactly 54 quotes in the minimal failure-inducing input):
|
(just trying to compiler 54 quotes, on the other hand, works fine, so it is context, not just that syntactic construction) |
charles-cooper
added a commit
that referenced
this issue
Jan 12, 2025
this commit removes `asttokens` from the parse machinery, since the method is buggy (see below bugs) and slow. this commit brings down parse time (time spent in ast generation) between 40-70%. the `mark_tokens()` machinery is replaced with a modified version of `python.ast`'s `fix_missing_locations()` function, which recurses through the AST and adds missing line info based on the parent node. it also changes to a more consistent method for updating source offsets that are modified by the `pre_parse` step, which fixes several outstanding bugs with source location reporting. there were some exceptions to the line info fixup working, the issues and corresponding workarounds are described as follows: - some python AST nodes returned by `ast.parse()` are singletons, which we work around by deepcopying the AST before operating on it. - notably, there is an interaction between our AST annotation and `coverage.py` in the case of `USub`. in this commit we paper over the issue by simply always overriding line info for `USub` nodes. in the future, we should refactor `VyperNode` generation by bypassing the python AST annotation step entirely, which is a more proper fix to the problems encountered in this PR. the `asttokens` package is not removed entirely since it still has a limited usage inside of the natspec parser. we could remove it in a future PR; for now it is out-of-scope. referenced bugs: - #2258 - #3059 - #3430 - #4139
fixed in #4364 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version Information
vyper --version
): 0.2.8+commit.d145722python --version
): Python 3.8.5pip freeze
):asttokens==2.0.4
Cython==0.29.21
dbus-python==1.2.16
pycryptodome==3.9.9
Pygments==2.3.1
PyGObject==3.36.0
python-afl==0.7.3
PyYAML==5.3.1
semantic-version==2.8.5
six==1.15.0
vyper==0.2.8
What's your issue about?
Note that this (like all fuzzing bugs I'll report) is minimized: removing one of the quotes makes it properly raise a SyntaxException:
The text was updated successfully, but these errors were encountered: