PR24827, Linker loops forever if unterminated multi-line comment in script

Message ID 20190720012654.GI3303@bubble.grove.modra.org
State New
Headers show
Series
  • PR24827, Linker loops forever if unterminated multi-line comment in script
Related show

Commit Message

Alan Modra July 20, 2019, 1:26 a.m.
YY_INPUT returns 0 on end of input, not EOF.  Committed.

	PR 24827
	* ldlex.l (comment): Check for 0 return from input(), not EOF.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/ld/ldlex.l b/ld/ldlex.l
index c2abc59571..a5c3ba5999 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -675,7 +675,7 @@  comment (void)
   while (1)
     {
       c = input();
-      while (c != '*' && c != EOF)
+      while (c != '*' && c != 0)
 	{
 	  if (c == '\n')
 	    lineno++;
@@ -694,7 +694,7 @@  comment (void)
       if (c == '\n')
 	lineno++;
 
-      if (c == EOF)
+      if (c == 0)
 	{
 	  einfo (_("%F%P: EOF in comment\n"));
 	  break;