-
Notifications
You must be signed in to change notification settings - Fork 18k
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
text/scanner: panic: runtime error: slice bounds out of range #29723
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Suggested
Issues that may be good for new contributors looking for work to do.
Milestone
Comments
The document said |
/cc @griesemer - Is the panic intentional ? Then it should be certainly documented. |
@agnivade This looks like a bug. |
Change https://golang.org/cl/157819 mentions this issue: |
nebulabox
pushed a commit
to nebulabox/go
that referenced
this issue
Feb 18, 2019
Make sure Scanner.tokEnd is set before we call Scanner.Error and update documentation accordingly. (Until now tokEnd was only set before returning from Scan, so a call to TokenText during error handling may have crashed.) While at it, tighten a check in Scanner.TokenText to ensure Scanner.tokEnd >= Scanner.tokPos if we have a token. Also, silence error messages to Stderr in unrelated TestIllegalExponent. Fixes golang#29723. Change-Id: Ia97beeae91eaf9e0ed3dada0a806f1f7122461cc Reviewed-on: https://go-review.googlesource.com/c/157819 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
nebulabox
pushed a commit
to nebulabox/go
that referenced
this issue
Feb 20, 2019
Make sure Scanner.tokEnd is set before we call Scanner.Error and update documentation accordingly. (Until now tokEnd was only set before returning from Scan, so a call to TokenText during error handling may have crashed.) While at it, tighten a check in Scanner.TokenText to ensure Scanner.tokEnd >= Scanner.tokPos if we have a token. Also, silence error messages to Stderr in unrelated TestIllegalExponent. Fixes golang#29723. Change-Id: Ia97beeae91eaf9e0ed3dada0a806f1f7122461cc Reviewed-on: https://go-review.googlesource.com/c/157819 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Suggested
Issues that may be good for new contributors looking for work to do.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
input.conf
) contains the followingGo PlayGround Link : https://play.golang.org/p/uIUPfT0L2Dx
What did you expect to see?
I expected that the scan.TokenText() method inside the error handler would return the last scanned token which is the unterminated literal.
What did you see instead?
I saw a panic message saying "slice bounds out of range"
The text was updated successfully, but these errors were encountered: