• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

修訂5a5b16cf7f3eb6845815be60f7bdc4c2bcf896a3 (tree)
時間2009-06-13 05:17:04
作者Android (Google) Code Review <android-gerrit@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge change 4084

* changes:

Handle end-of-file inside of comments, local declarations.

Change Summary

差異

--- a/libacc/acc.cpp
+++ b/libacc/acc.cpp
@@ -1995,18 +1995,21 @@ class Compiler : public ErrorSink {
19951995 }
19961996 } else if ((tok == '/') & (ch == '*')) {
19971997 inp();
1998- while (ch) {
1999- while (ch != '*')
1998+ while (ch && ch != EOF) {
1999+ while (ch != '*' && ch != EOF)
20002000 inp();
20012001 inp();
20022002 if (ch == '/')
20032003 ch = 0;
20042004 }
2005+ if (ch == EOF) {
2006+ error("End of file inside comment.");
2007+ }
20052008 inp();
20062009 next();
20072010 } else if ((tok == '/') & (ch == '/')) {
20082011 inp();
2009- while (ch && (ch != '\n')) {
2012+ while (ch && (ch != '\n') && (ch != EOF)) {
20102013 inp();
20112014 }
20122015 inp();
@@ -2489,7 +2492,7 @@ class Compiler : public ErrorSink {
24892492 Type base;
24902493
24912494 while (acceptType(base)) {
2492- while (tok != ';') {
2495+ while (tok != ';' && tok != EOF) {
24932496 Type t = acceptPointerDeclaration(t);
24942497 addLocalSymbol();
24952498 if (tok) {