projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cdc5a03
)
(layout_record): Avoid overflow in const_size by adding into var_size instead.
author
Richard Stallman
<rms@gnu.org>
Thu, 31 Dec 1992 08:33:11 +0000
(08:33 +0000)
committer
Richard Stallman
<rms@gnu.org>
Thu, 31 Dec 1992 08:33:11 +0000
(08:33 +0000)
From-SVN: r3007
gcc/stor-layout.c
patch
|
blob
|
history
diff --git
a/gcc/stor-layout.c
b/gcc/stor-layout.c
index e28080204141cc92654a9091052646d88199cbff..3d1ce08e26c7633659087befeba6d5397b895707 100644
(file)
--- a/
gcc/stor-layout.c
+++ b/
gcc/stor-layout.c
@@
-451,7
+451,10
@@
layout_record (rec)
printed in finish_struct. */
if (dsize == 0)
/* Do nothing. */;
- else if (TREE_CODE (dsize) == INTEGER_CST)
+ else if (TREE_CODE (dsize) == INTEGER_CST
+ && TREE_INT_CST_HIGH (dsize) == 0
+ && TREE_INT_CST_LOW (dsize) + const_size > const_size)
+ /* Use const_size if there's no overflow. */
const_size += TREE_INT_CST_LOW (dsize);
else
{