libgfortran: Fix negation for largest integer [PR81986]
libgfortran/ChangeLog: 2021-03-01 Vittorio Zecca <zeccav@gmail.com> Tobias Burnus <tobias@codesourcery.com> PR libfortran/81986 * runtime/string.c (gfc_itoa): Cast to unsigned before negating.
This commit is contained in:
parent
f8e7f3f3f3
commit
006693a59f
1 changed files with 1 additions and 1 deletions
|
@ -196,7 +196,7 @@ gfc_itoa (GFC_INTEGER_LARGEST n, char *buffer, size_t len)
|
|||
if (n < 0)
|
||||
{
|
||||
negative = 1;
|
||||
t = -n; /*must use unsigned to protect from overflow*/
|
||||
t = -(GFC_UINTEGER_LARGEST) n; /* Must use unsigned to protect from overflow. */
|
||||
}
|
||||
|
||||
p = buffer + GFC_ITOA_BUF_SIZE - 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue