diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-27 10:46:57 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2020-01-30 10:01:46 +0900 |
commit | 716e05b82338d75452e86c999ae3e5874a642ecd (patch) | |
tree | c09a8d110092038a0a9f28f9d107aab544ff12fe /gc.c | |
parent | 52bb32d6b71365cb24273de3eed5a712206815f3 (diff) |
Fixed a segfault `GC.verify_compaction_references`
Which is by coercion of `Qundef`, when any keyword argument
without `toward:` option is given. [Bug #16598]
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -8618,7 +8618,7 @@ gc_compact_after_gc(rb_objspace_t *objspace, int use_toward_empty, int use_doubl /* * call-seq: - * GC.verify_compaction_references -> nil + * GC.verify_compaction_references(toward: nil, double_heap: nil) -> nil * * Verify compaction reference consistency. * @@ -8656,7 +8656,7 @@ gc_verify_compaction_references(int argc, VALUE *argv, VALUE mod) } rb_get_kwargs(opt, keyword_ids, 0, 2, kwvals); - if (rb_intern("empty") == rb_sym2id(kwvals[0])) { + if (kwvals[0] != Qundef && rb_intern("empty") == rb_sym2id(kwvals[0])) { use_toward_empty = TRUE; } if (kwvals[1] != Qundef && RTEST(kwvals[1])) { |