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

Interactive mode crashes when a \ is typed after a ". #603

Closed
MageJohn opened this issue Sep 19, 2018 · 1 comment · Fixed by #615
Closed

Interactive mode crashes when a \ is typed after a ". #603

MageJohn opened this issue Sep 19, 2018 · 1 comment · Fixed by #615

Comments

@MageJohn
Copy link

MageJohn commented Sep 19, 2018

When I run wren in interactive mode and start to type out a string literal with a backslash escape sequence, the program immediately crashes. The crash is not very graceful, printing the error without a newline in front, and leaving the terminal text in the colour of the syntax highlighted ".

The error is:

Range end out of bounds.
[repl line 555] in text
[repl line 344] in refreshLine(_)
[repl line 28] in run()
[repl line 929] in (script)
[<repl> line 1] in (script)

My system is GalliumOS, which is based on Xubuntu. I compiled wren per the instructions on the Getting Started page.

EDIT: I get the same problem on Arch Linux, with wren installed from community repo. The line numbers have changed, but this is probably just because they're different versions.

@do-you-dare
Copy link

I can confirm this issue on Fedora 28 as well, with latest wren compiled with gcc 8.1.1

iwillspeak added a commit to iwillspeak/wren that referenced this issue Oct 8, 2018
When parsing the string token if a `\` was used it would
unconditionally consume the next character. This would led to a token
with an invalid lenght causing a crash when it was printed. This fixes
that by only consuming the token after the `\` if there is one to
consume.

Fixes wren-lang#603
iwillspeak added a commit to iwillspeak/wren that referenced this issue Feb 12, 2019
When parsing the string token if a `\` was used it would
unconditionally consume the next character. This would led to a token
with an invalid lenght causing a crash when it was printed. This fixes
that by only consuming the token after the `\` if there is one to
consume.

Fixes wren-lang#603
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants