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
2194 2194
rb_dump_backtrace_with_lines(int num_traces, void **traces)
2195 2195
{
2196 2196
    int i;
2197
    for (i = 0; i < num_traces; i++) {
2198
#if defined(__arm__)
2199
	traces[i] = (void *)(((uintptr_t)traces[i] & (~1)) - 1);
2200
#else
2201
	traces[i] = (void *)((uintptr_t)traces[i] - 1);
2202
#endif
2203
    }
2197 2204
    /* async-signal unsafe */
2198 2205
    line_info_t *lines = (line_info_t *)calloc(num_traces, sizeof(line_info_t));
2199 2206
    obj_info_t *obj = NULL;