diff options
author | 卜部昌平 <[email protected]> | 2019-10-10 00:10:14 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2019-10-10 00:13:30 +0900 |
commit | 9b919885a08d6cf3c68cb1bce992feb43a8fad0c (patch) | |
tree | 00ed983087ea385c4caac298101fdee0f4389dc5 /gc.c | |
parent | bb71a128eb6e901d3d7deb895971a6706eb7110d (diff) |
fix memory corruption in old GCC
This typo introduced memory corruption when __builtin_add_overflow
is not available but uint128_t is. GCC before 5 are one of such
situatins.
See also https://rubyci.org/logs/rubyci.s3.amazonaws.com/opensuseleap/ruby-master/log/20191009T120004Z.log.html.gz
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -135,7 +135,7 @@ size_add_overflow(size_t x, size_t y) #elif defined(DSIZE_T) RB_GNUC_EXTENSION DSIZE_T dx = x; - RB_GNUC_EXTENSION DSIZE_T dy = x; + RB_GNUC_EXTENSION DSIZE_T dy = y; RB_GNUC_EXTENSION DSIZE_T dz = dx + dy; p = dz > SIZE_MAX; z = (size_t)dz; |