aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.cc
diff options
context:
space:
mode:
authorGaius Mulley <gaiusmod2@gmail.com>2024-05-15 16:58:21 +0100
committerGaius Mulley <gaiusmod2@gmail.com>2024-05-15 16:58:21 +0100
commit680af0e1e90d4b80260d173636dfe15654fd470d (patch)
treedd8157dd5778cffd6c6b874e987afae49f082a48 /gcc/cp/parser.cc
parent3cefe91b74f65f0db71472e01ca83c69e2cd81cc (diff)
downloadgcc-680af0e1e90d4b80260d173636dfe15654fd470d.zip
gcc-680af0e1e90d4b80260d173636dfe15654fd470d.tar.gz
gcc-680af0e1e90d4b80260d173636dfe15654fd470d.tar.bz2
PR modula2/115057 TextIO.ReadRestLine raises an exception when buffer is exceeded
TextIO.ReadRestLine will raise an "attempting to read beyond end of file" exception if the buffer is exceeded. This bug is caused by the TextIO.ReadRestLine calling IOChan.Skip without a preceeding IOChan.Look. The Look procedure will update the status result whereas Skip always sets read result to allRight. gcc/m2/ChangeLog: PR modula2/115057 * gm2-libs-iso/TextIO.mod (ReadRestLine): Use ReadChar to skip unwanted characters as this calls IOChan.Look and updates the cid result status. A Skip without a Look does not update the status. Skip always sets read result to allRight. * gm2-libs-iso/TextUtil.def (SkipSpaces): Improve comments. (CharAvailable): Improve comments. * gm2-libs-iso/TextUtil.mod (SkipSpaces): Improve comments. (CharAvailable): Improve comments. gcc/testsuite/ChangeLog: PR modula2/115057 * gm2/isolib/run/pass/testrestline.mod: New test. * gm2/isolib/run/pass/testrestline2.mod: New test. * gm2/isolib/run/pass/testrestline3.mod: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'gcc/cp/parser.cc')
0 files changed, 0 insertions, 0 deletions