mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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 20191009
T120004Z.log.html.gz
This commit is contained in:
parent
bb71a128eb
commit
9b919885a0
2 changed files with 1 additions and 2 deletions
|
@ -427,7 +427,6 @@ tests.compact.each do |(insn, expr, *a)|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# with trace
|
# with trace
|
||||||
tests.compact.each {|(insn, expr, *a)|
|
tests.compact.each {|(insn, expr, *a)|
|
||||||
progn = "set_trace_func(proc{})\n" + expr
|
progn = "set_trace_func(proc{})\n" + expr
|
||||||
|
|
2
gc.c
2
gc.c
|
@ -135,7 +135,7 @@ size_add_overflow(size_t x, size_t y)
|
||||||
|
|
||||||
#elif defined(DSIZE_T)
|
#elif defined(DSIZE_T)
|
||||||
RB_GNUC_EXTENSION DSIZE_T dx = x;
|
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;
|
RB_GNUC_EXTENSION DSIZE_T dz = dx + dy;
|
||||||
p = dz > SIZE_MAX;
|
p = dz > SIZE_MAX;
|
||||||
z = (size_t)dz;
|
z = (size_t)dz;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue