From 5bb48dc68ad35a78659d3075a9e3172785dcfbeb Mon Sep 17 00:00:00 2001 From: shyouhei Date: Fri, 19 Oct 2018 08:46:41 +0000 Subject: [PATCH] compile.c: default_len is positive Recent GCC warns that default_len can be negative (thus can overflow PTRDIFF_MAX), which is a false assert. Suppresses warnings by adding __builtin_unreachable. See also: https://travis-ci.org/ruby/ruby/jobs/443568193#L2227 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compile.c b/compile.c index 2a4680476b..272b9ddacc 100644 --- a/compile.c +++ b/compile.c @@ -8083,6 +8083,9 @@ iseq_build_kw(rb_iseq_t *iseq, VALUE params, VALUE keywords) keyword->table = ids; return keyword; } + else if (default_len < 0) { + UNREACHABLE; + } dvs = ALLOC_N(VALUE, (unsigned int)default_len);