Project

General

Profile

Bug #17656 ยป ruby-backtrace-address-off-by-1.patch

xtkoba (Tee KOBAYASHI), 02/24/2021 11:20 PM

View differences:

addr2line.c
rb_dump_backtrace_with_lines(int num_traces, void **traces)
{
int i;
for (i = 0; i < num_traces; i++) {
#if defined(__arm__)
traces[i] = (void *)(((uintptr_t)traces[i] & (~1)) - 1);
#else
traces[i] = (void *)((uintptr_t)traces[i] - 1);
#endif
}
/* async-signal unsafe */
line_info_t *lines = (line_info_t *)calloc(num_traces, sizeof(line_info_t));
obj_info_t *obj = NULL;
    (1-1/1)