• Rob Pike's avatar
    bufio: don't loop generating empty tokens · 590f5283
    Rob Pike authored
    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 #9020.
    
    LGTM=rsc, adg
    R=golang-codereviews, rsc, adg, bradfitz
    CC=golang-codereviews
    https://golang.org/cl/169970043
    590f5283
scan.go 11.4 KB