зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
bb71a128eb
Коммит
9b919885a0
|
@ -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;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче