Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1624)

Issue 169970043: code review 169970043: bufio: don't loop generating empty tokens (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 6 months ago by r
Modified:
9 years, 6 months ago
Reviewers:
rsc, adg1
CC:
golang-codereviews, adg1, bradfitz
Visibility:
Public.

Description

bufio: don't loop generating empty tokens The new rules for split functions mean that we are exposed to the common bug of a function that loops forever at EOF. Pick these off by shutting down the scanner if too many consecutive empty tokens are delivered. Fixes issue 9020.

Patch Set 1 #

Total comments: 1

Patch Set 2 : diff -r 284a98e61e32b9980118392fd5d4a596b2f49d20 https://code.google.com/p/go #

Patch Set 3 : diff -r b06214628602255a3a615036c17e71c621051e16 https://code.google.com/p/go #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -0 lines) Patch
M src/bufio/scan.go View 1 4 chunks +12 lines, -0 lines 1 comment Download
M src/bufio/scan_test.go View 1 1 chunk +58 lines, -0 lines 0 comments Download

Messages

Total messages: 9
r
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
9 years, 6 months ago (2014-11-05 01:49:15 UTC) #1
rsc
LGTM Should it panic instead? 100 bogus tokens have been returned.
9 years, 6 months ago (2014-11-05 01:59:05 UTC) #2
adg1
https://codereview.appspot.com/169970043/diff/1/src/bufio/scan.go File src/bufio/scan.go (right): https://codereview.appspot.com/169970043/diff/1/src/bufio/scan.go#newcode133 src/bufio/scan.go:133: if s.empties > 100 { 100 seems low and ...
9 years, 6 months ago (2014-11-05 02:00:09 UTC) #3
bradfitz
I hope one of you is wrong. Reading a file with bufio.Scanner, any number of ...
9 years, 6 months ago (2014-11-05 02:07:09 UTC) #4
r
Hello golang-codereviews@googlegroups.com, rsc@golang.org, adg@google.com, bradfitz@golang.org (cc: golang-codereviews@googlegroups.com), Please take another look.
9 years, 6 months ago (2014-11-05 02:56:15 UTC) #5
adg1
LGTM
9 years, 6 months ago (2014-11-05 05:30:39 UTC) #6
r
*** Submitted as https://code.google.com/p/go/source/detail?r=515e1c64bda6 *** bufio: don't loop generating empty tokens The new rules for ...
9 years, 6 months ago (2014-11-05 22:57:50 UTC) #7
rsc
https://codereview.appspot.com/169970043/diff/40001/src/bufio/scan.go File src/bufio/scan.go (right): https://codereview.appspot.com/169970043/diff/40001/src/bufio/scan.go#newcode131 src/bufio/scan.go:131: if len(token) > 0 { if advance > 0 ...
9 years, 6 months ago (2014-11-06 00:35:36 UTC) #8
rsc
9 years, 6 months ago (2014-11-06 00:53:50 UTC) #9
https://codereview.appspot.com/170030043 fixes the blank line issue that
Brad pointed out.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b