bufio: make scanning bounded and incremental
This commit is contained in:
@@ -23,6 +23,7 @@ package regex;
|
||||
|
||||
import ascii;
|
||||
import bufio;
|
||||
import errors;
|
||||
import io;
|
||||
import memio;
|
||||
import strconv;
|
||||
@@ -1209,7 +1210,7 @@ fn search(
|
||||
// Unreachable: this scanner is newscanner(h, I32_MAX), so the
|
||||
// can't-grow ceiling is never hit; the arm keeps the match
|
||||
// total over scanrune's widened overflow surface (drain F-B).
|
||||
case bufio.overflow => abort("regex: scanrune overflow");
|
||||
case errors.overflow => abort("regex: scanrune overflow");
|
||||
};
|
||||
if (r_or_end is rune) {
|
||||
last_bytesize = (utf8.runesz(r_or_end as rune): size);
|
||||
|
||||
Reference in New Issue
Block a user