summaryrefslogtreecommitdiff
path: root/test/files/neg/unicode-unterminated-quote.check
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-01-31 00:14:47 -0800
committerPaul Phillips <paulp@improving.org>2012-02-01 14:09:23 -0800
commit264ff5d5e8dbec4ae2e13bf52e66a965d884b25c (patch)
tree4af5300946ce2fe20064f153b703b1317769093e /test/files/neg/unicode-unterminated-quote.check
parentfbd5efe49cf23b446762dfa5026e8bac82ab04fc (diff)
downloadscala-264ff5d5e8dbec4ae2e13bf52e66a965d884b25c.tar.gz
scala-264ff5d5e8dbec4ae2e13bf52e66a965d884b25c.tar.bz2
scala-264ff5d5e8dbec4ae2e13bf52e66a965d884b25c.zip
Fix for parser OOM.
The scanner performs some sketchy heuristics when it sees an ascii 1A since it may be EOF or it may be part of a literal. Due to this, it failed to detect an unterminated string literal if the opening quote was unicode-escaped, leading to memory exhaustion as it read SUs until the universe ended. We're parsing a fixed input with known length! There's no reason to be guessing about whether a char is EOF. If we're at the end of the file, it's the end of file. Otherwise, it is not the end of the file.
Diffstat (limited to 'test/files/neg/unicode-unterminated-quote.check')
-rw-r--r--test/files/neg/unicode-unterminated-quote.check4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/files/neg/unicode-unterminated-quote.check b/test/files/neg/unicode-unterminated-quote.check
new file mode 100644
index 0000000000..fc5caa6d7e
--- /dev/null
+++ b/test/files/neg/unicode-unterminated-quote.check
@@ -0,0 +1,4 @@
+unicode-unterminated-quote.scala:2: error: unclosed string literal
+ val x = /u0022
+ ^
+one error found