projects
/
platform
/
upstream
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f8e7f3f
)
libgfortran: Fix negation for largest integer [PR81986]
author
Tobias Burnus
<tobias@codesourcery.com>
Wed, 3 Mar 2021 07:05:45 +0000
(08:05 +0100)
committer
Tobias Burnus
<tobias@codesourcery.com>
Wed, 3 Mar 2021 07:07:16 +0000
(08:07 +0100)
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.
libgfortran/runtime/string.c
patch
|
blob
|
history
diff --git
a/libgfortran/runtime/string.c
b/libgfortran/runtime/string.c
index
37c4da0
..
536a9cd
100644
(file)
--- a/
libgfortran/runtime/string.c
+++ b/
libgfortran/runtime/string.c
@@
-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;