diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-01-29 15:21:18 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-01-29 15:30:15 +0100 |
commit | 0eefa77be199b1d8186a7a6978f8e01132f35cd9 (patch) | |
tree | 1a57eea6a9f6dab2b51b073e5ffbf9e70a434e88 /test/files/neg/quasiquotes-syntax-error-position.check | |
parent | 1e9dcc2ed603e7179b7b5eee9212e73f773b02fd (diff) | |
download | scala-0eefa77be199b1d8186a7a6978f8e01132f35cd9.tar.gz scala-0eefa77be199b1d8186a7a6978f8e01132f35cd9.tar.bz2 scala-0eefa77be199b1d8186a7a6978f8e01132f35cd9.zip |
SI-8205 Avoid long, slow march to AIIOBE in SourceFile#lineContent
Fixing a regression from SI-8015.
The failure mode is kind of amusing: a while loop in `lineToString`
would count all the way to `Int.MaxValue`, and integer overflow
would foil a bounds check when looking for the 'LF' in 'CR'-'LF'.
Given that we're not a style checker to enforce that source files
end in a new-line, this commit accounts for EOF, and fixed the
overflow problem too.
A JUnit test exercises the bug and a few other variations of
`lineContent`.
While i was in the neighbourhood, I opted for a more efficient
means to slice out that line.
Diffstat (limited to 'test/files/neg/quasiquotes-syntax-error-position.check')
0 files changed, 0 insertions, 0 deletions