aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorGaius Mulley <gaiusmod2@gmail.com>2023-01-27 22:18:46 +0000
committerGaius Mulley <gaiusmod2@gmail.com>2023-01-27 22:18:46 +0000
commit97bf709f35af45f9cf2902904d82493efed0d2ec (patch)
treef53f7c974d358568b6a416c63a816287cd8df5dc /gcc/c
parent84eb39556cc8449e04b5f48bd5c131941a7a2529 (diff)
downloadgcc-97bf709f35af45f9cf2902904d82493efed0d2ec.zip
gcc-97bf709f35af45f9cf2902904d82493efed0d2ec.tar.gz
gcc-97bf709f35af45f9cf2902904d82493efed0d2ec.tar.bz2
PR-108557 Stuck compilation for empty file
Trying to compile an empty file causes cc1gm2 to hang. The bug occurs when M2LexBuf.mod calls m2flex.GetToken after an eof token has been seen which results in m2flex attempting to read from stdin. The bug fix detects eof per file and blocks subsequent calls to m2flex.GetToken. gcc/m2/ChangeLog: * gm2-compiler/M2Comp.mod: Import MetaString0. (ExamineCompilationUnit): New variable Message. Create and format error string. * gm2-compiler/M2LexBuf.mod: New variable SeenEof. (GetNonEofToken): New procedure. (Init): Set SeenEof to FALSE. (GetToken): Use GetNonEofToken instead of calls to m2flex.GetToken and GetToken. (AddTok): Detect eoftok and set SeenEof. gcc/testsuite/ChangeLog: * gm2/pim/fail/empty.mod: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions