diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/compiler/lex.zc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/lex.zc b/src/compiler/lex.zc index d06b81b..2763333 100644 --- a/src/compiler/lex.zc +++ b/src/compiler/lex.zc @@ -428,6 +428,7 @@ int docblock(int nl) { doc_char(c); if (c == 10) bol = 1; } + if (ch < 0) { tline = line; serr("unterminated comment"); } while (dn && (dbuf[dn - 1] == 32 || dbuf[dn - 1] == 9 || dbuf[dn - 1] == 10 || dbuf[dn - 1] == 13)) dn--; doc_char(10); dlast = cl; docpending = 1; if (adj) dn = 0; @@ -489,6 +490,7 @@ int lex1() { if (docs_on) { docblock(nl); tglue = 0; continue; } nextch(); while (ch >= 0) { if (ch == '*') { nextch(); if (ch == '/') break; } else nextch(); } + if (ch < 0) { tline = line; serr("unterminated comment"); } // a /* with no */ (spec 1.2.2) nextch(); tglue = 0; continue; } tline = line; toff = cpos() - 1; tbuf[0] = '/'; oplex(1); return 0; |
