diff options
author | nagachika <nagachika@ruby-lang.org> | 2022-03-12 14:43:41 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2022-03-12 14:43:41 +0900 |
commit | 2ec864d9b7a2c79b5bd9136665aa6f705fa76e53 (patch) | |
tree | 2139e5c94e784de7b7a3c841e9a7a42ecd9b2ee7 | |
parent | 951e1377c18f84b52fbd3aab048da8536a3bbdb0 (diff) | |
download | ruby-2ec864d9b7a2c79b5bd9136665aa6f705fa76e53.tar.gz |
merge revision(s) 9f0c6f20c58067923864575b60af730d191b8f6c: [Backport #18382]
[Bug #18382] Fix crash in compaction for
ObjectSpace.trace_object_allocations
ObjectSpace.trace_object_allocations can crash when auto-compaction is
enabled.
---
ext/objspace/object_tracing.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
-rw-r--r-- | ext/objspace/object_tracing.c | 3 | ||||
-rw-r--r-- | version.h | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/ext/objspace/object_tracing.c b/ext/objspace/object_tracing.c index 4973a7535b..66d6baa491 100644 --- a/ext/objspace/object_tracing.c +++ b/ext/objspace/object_tracing.c @@ -208,7 +208,8 @@ allocation_info_tracer_compact(void *ptr) { struct traceobj_arg *trace_arg = (struct traceobj_arg *)ptr; - if (st_foreach_with_replace(trace_arg->object_table, hash_foreach_should_replace_key, hash_replace_key, 0)) { + if (trace_arg->object_table && + st_foreach_with_replace(trace_arg->object_table, hash_foreach_should_replace_key, hash_replace_key, 0)) { rb_raise(rb_eRuntimeError, "hash modified during iteration"); } } @@ -12,11 +12,11 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 4 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 180 +#define RUBY_PATCHLEVEL 181 #define RUBY_RELEASE_YEAR 2022 -#define RUBY_RELEASE_MONTH 2 -#define RUBY_RELEASE_DAY 19 +#define RUBY_RELEASE_MONTH 3 +#define RUBY_RELEASE_DAY 12 #include "ruby/version.h" |