summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-27 10:46:57 +0900
committerNARUSE, Yui <naruse@airemix.jp>2020-01-30 10:01:46 +0900
commit716e05b82338d75452e86c999ae3e5874a642ecd (patch)
treec09a8d110092038a0a9f28f9d107aab544ff12fe /gc.c
parent52bb32d6b71365cb24273de3eed5a712206815f3 (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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index 131ffb8246..4704925abc 100644
--- a/gc.c
+++ b/gc.c
@@ -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])) {