Patch to error and fail instead of using all available memory
then crashing to detect the error condition of an unmatched
double quote before the end of a file.
I couldn't get it to show nice error messages, so this may not be
the ideal fix.
A test case for this situation has also been added.
ret token::LIT_CHAR(c2);
}
'"' {
+ let n = rdr.get_chpos();
rdr.bump();
while rdr.curr() != '"' {
+ if rdr.is_eof() {
+ rdr.err(#fmt["unterminated double quote string: %s",
+ rdr.get_str_from(n)]);
+ fail;
+ }
+
let ch = rdr.curr();
rdr.bump();
alt ch {
--- /dev/null
+// -*- rust -*-
+
+// error-pattern: unterminated double quote string
+
+
+fn main() {
+ "
+}