chew ubsan warning

Alan Modra amodra@gmail.com
Fri Aug 6 13:35:18 GMT 2021


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.

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);
     }
 }
 

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list