ruby-changes:66557
From: eileencodes <ko1@a...>
Date: Wed, 23 Jun 2021 06:34:22 +0900 (JST)
Subject: [ruby-changes:66557] 4f77a54f07 (master): Fix asan error when walking heap for T_PAYLOAD objects
https://git.ruby-lang.org/ruby.git/commit/?id=4f77a54f07 From 4f77a54f07b17b19e0dd329877ce9895d98c6cad Mon Sep 17 00:00:00 2001 From: eileencodes <eileencodes@g...> Date: Tue, 22 Jun 2021 14:00:16 -0400 Subject: Fix asan error when walking heap for T_PAYLOAD objects Related to https://bugs.ruby-lang.org/issues/18001 Co-authored-by: Aaron Patterson <tenderlove@r...> --- gc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gc.c b/gc.c index 09420de..44a1992 100644 --- a/gc.c +++ b/gc.c @@ -3552,16 +3552,18 @@ objspace_each_objects_try(VALUE arg) https://github.com/ruby/ruby/blob/trunk/gc.c#L3552 while (cursor_end < pend) { int payload_len = 0; +#if USE_RVARGC while (cursor_end < pend && BUILTIN_TYPE((VALUE)cursor_end) != T_PAYLOAD) { cursor_end++; } -#if USE_RVARGC //Make sure the Payload header slot is yielded if (cursor_end < pend && BUILTIN_TYPE((VALUE)cursor_end) == T_PAYLOAD) { payload_len = RPAYLOAD_LEN((VALUE)cursor_end); cursor_end++; } +#else + cursor_end = pend; #endif if ((*data->callback)(pstart, cursor_end, sizeof(RVALUE), data->data)) { -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/