]> Cypherpunks.ru repositories - gostls13.git/commit
go/scanner: fall back to next() when encountering 0 bytes in parseIdentifier
authorRob Findley <rfindley@google.com>
Mon, 21 Jun 2021 16:52:17 +0000 (12:52 -0400)
committerRobert Findley <rfindley@google.com>
Mon, 21 Jun 2021 17:37:39 +0000 (17:37 +0000)
commit20bdfba32590c3dcce8885df875dc56a84b2d269
treeef1917de7a84a9714131c93aa2b28c3952907fe3
parent44f9a3566ce564f9a21b1b92940a520ea241e065
go/scanner: fall back to next() when encountering 0 bytes in parseIdentifier

CL 308611 optimized parseIdentifier for ASCII, but inadvertently skipped
error handling for 0 bytes. Don't take the optimized path when
encountering 0.

Fixes #46855

Change-Id: Ic584e077eb74c012611fefa20eb71ca09c81b3c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/329790
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/scanner/scanner.go
src/go/scanner/scanner_test.go