ubsan: signed integer overflow in atof_generic
authorAlan Modra <amodra@gmail.com>
Thu, 2 Jun 2022 08:58:57 +0000 (18:28 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 2 Jun 2022 08:58:57 +0000 (18:28 +0930)
commitb038f394a9fb41b3bc45a55e6bffac5bac9fe9ef
tree9f58bb405bdc12224d4f36cf715db77bace2816c
parentee6cbff21381025f988457d9481d5b3b8d05bb72
ubsan: signed integer overflow in atof_generic

Fix the signed overflows by using unsigned variables and detect
overflow at BUG! comment.

* atof-generic.c (atof_generic): Avoid signed integer overflow.
Return ERROR_EXPONENT_OVERFLOW if exponent overflows a long.
gas/atof-generic.c