chew ubsan warning

Message ID YQ06ljmXG8GwtdPW@squeak.grove.modra.org
State New
Headers show
Series
  • chew ubsan warning
Related show

Commit Message

Alan Modra via Binutils Aug. 6, 2021, 1:35 p.m.
It matters not at all if pc is incremented from its initial NULL
value, but avoid this silly runtime ubsan error.

	* doc/chew.c (perform): Avoid incrementing NULL pc.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c
index b3be7fa9cda..9271cd107f9 100644
--- a/bfd/doc/chew.c
+++ b/bfd/doc/chew.c
@@ -1301,12 +1301,12 @@  perform (void)
 	    {
 	      if (warning)
 		fprintf (stderr, "warning, %s is not recognised\n", next);
-	      skip_past_newline ();
+	      idx = skip_past_newline_1 (ptr, idx);
 	    }
 	  free (next);
 	}
       else
-	skip_past_newline ();
+	idx = skip_past_newline_1 (ptr, idx);
     }
 }