[前][次][番号順一覧][スレッド一覧]

ruby-changes:52953

From: shyouhei <ko1@a...>
Date: Fri, 19 Oct 2018 17:46:47 +0900 (JST)
Subject: [ruby-changes:52953] shyouhei:r65167 (trunk): compile.c: default_len is positive

shyouhei	2018-10-19 17:46:41 +0900 (Fri, 19 Oct 2018)

  New Revision: 65167

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65167

  Log:
    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

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 65166)
+++ compile.c	(revision 65167)
@@ -8083,6 +8083,9 @@ iseq_build_kw(rb_iseq_t *iseq, VALUE par https://github.com/ruby/ruby/blob/trunk/compile.c#L8083
 	keyword->table = ids;
 	return keyword;
     }
+    else if (default_len < 0) {
+        UNREACHABLE;
+    }
 
     dvs = ALLOC_N(VALUE, (unsigned int)default_len);
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]