Title: Parse panics (index out of range) on an unterminated string ending in a backslash · Issue #54 · go-ruby-parser/parser · GitHub
Open Graph Title: Parse panics (index out of range) on an unterminated string ending in a backslash · Issue #54 · go-ruby-parser/parser
X Title: Parse panics (index out of range) on an unterminated string ending in a backslash · Issue #54 · go-ruby-parser/parser
Description: parser.Parse panics on a two-byte source, a double quote followed by a backslash: an unterminated string whose last character is the escape character. parser.Parse("\"\\") panic: runtime error: index out of range [2] with length 2 github...
Open Graph Description: parser.Parse panics on a two-byte source, a double quote followed by a backslash: an unterminated string whose last character is the escape character. parser.Parse("\"\\") panic: runtime error: ind...
X Description: parser.Parse panics on a two-byte source, a double quote followed by a backslash: an unterminated string whose last character is the escape character. parser.Parse("\"\\") panic: run...
Opengraph URL: https://github.com/go-ruby-parser/parser/issues/54
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Parse panics (index out of range) on an unterminated string ending in a backslash","articleBody":"`parser.Parse` panics on a two-byte source, a double quote followed by a backslash: an unterminated string whose last character is the escape character.\n\n```go\nparser.Parse(\"\\\"\\\\\")\n```\n\n```\npanic: runtime error: index out of range [2] with length 2\n\ngithub.com/go-ruby-parser/parser/lexer.(*Lexer).advance(...)\n\tlexer/lexer.go:109\ngithub.com/go-ruby-parser/parser/lexer.(*Lexer).scanStringSegment(...)\n\tlexer/lexer.go:2350\ngithub.com/go-ruby-parser/parser/lexer.(*Lexer).lexString(...)\n\tlexer/lexer.go:2242\ngithub.com/go-ruby-parser/parser/lexer.(*Lexer).lexToken(...)\n\tlexer/lexer.go:330\n```\n\nThe expected result is a parse error (\"unterminated string meets end of file\", as MRI reports it), not a panic. It is reachable from user input everywhere the parser runs:\n\n- `rbgo` on such a file crashes with the panic;\n- an embedding host crashes when it evaluates the source (go-embedded-ruby/ruby now guards `Interp.Eval` against it);\n- a go-notebook Ruby cell typed as `\"\\` crashed the notebook's analysis (now guarded too).\n\nVersion: v0.13.1, the latest. Found by fuzzing go-notebook's analysis of Ruby cells; the corpus entry is `string(\"\\\"\\\\\")`.\n","author":{"url":"https://github.com/tannevaled","@type":"Person","name":"tannevaled"},"datePublished":"2026-10-18T13:32:11Z","url":"https://github.com/go-ruby-parser/parser/issues/54"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f304c5e2-11a6-6135-345f-bfdf135672f1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 924A:DB235:CF3E7A:11CC4A0:6B04029F |
| html-safe-nonce | 3cc4de359c5d56acc7c61deab6c2b575517ffba3f0a29cea3c2e5736d1f60614 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjRBOkRCMjM1OkNGM0U3QToxMUNDNEEwOjZCMDQwMjlGIiwidmlzaXRvcl9pZCI6IjQxMDUwODU1NjQyNTc1NzM0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fc4f73877c8ccc2a641d70a88c7396e5877dfb4c6dd1f695830252e332c6364f |
| hovercard-subject-tag | issue:5910044622 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/go-ruby-parser/parser/54/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3f119b323e0c57f718ae900927132c45f2113a26f5f1a93f06b370b1375597de/go-ruby-parser/parser/issues/54 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3f119b323e0c57f718ae900927132c45f2113a26f5f1a93f06b370b1375597de/go-ruby-parser/parser/issues/54 |
| og:image:alt | parser.Parse panics on a two-byte source, a double quote followed by a backslash: an unterminated string whose last character is the escape character. parser.Parse("\"\\") panic: runtime error: ind... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tannevaled |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/go-ruby-parser/parser git https://github.com/go-ruby-parser/parser.git |
| octolytics-dimension-user_id | 295635196 |
| octolytics-dimension-user_login | go-ruby-parser |
| octolytics-dimension-repository_id | 1276240137 |
| octolytics-dimension-repository_nwo | go-ruby-parser/parser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1276240137 |
| octolytics-dimension-repository_network_root_nwo | go-ruby-parser/parser |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width