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

ruby-changes:61483

From: Nobuyoshi <ko1@a...>
Date: Thu, 4 Jun 2020 17:12:25 +0900 (JST)
Subject: [ruby-changes:61483] 2b7454eb92 (master): Update leaked-globals [Bug #16934]

https://git.ruby-lang.org/ruby.git/commit/?id=2b7454eb92

From 2b7454eb922ccbda065affc92e2e94c7c28b809f Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 4 Jun 2020 16:24:45 +0900
Subject: Update leaked-globals [Bug #16934]

* match uppercase types which would be global, other than [BDT]
* ignore `RUBY_` prefixed symbols

diff --git a/common.mk b/common.mk
index a7bb495..bc0044f 100644
--- a/common.mk
+++ b/common.mk
@@ -356,7 +356,7 @@ $(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A) https://github.com/ruby/ruby/blob/trunk/common.mk#L356
 ruby.imp: $(COMMONOBJS)
 	$(Q){ \
 	$(NM) -Pgp $(COMMONOBJS) | \
-	awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^$(SYMBOL_PREFIX)(Init_|InitVM_|ruby_static_id_|.*_threadptr_|rb_ec_)|^\./{print $$1}'; \
+	awk 'BEGIN{print "#!"}; $$2~/^[A-TV-Z]$$/&&$$1!~/^$(SYMBOL_PREFIX)(Init_|InitVM_|ruby_static_id_|.*_threadptr_|rb_ec_)|^\./{print $$1}'; \
 	($(CHDIR) $(srcdir) && \
 	 exec sed -n '/^MJIT_FUNC_EXPORTED/!d;N;s/.*\n\(rb_[a-zA-Z_0-9]*\).*/$(SYMBOL_PREFIX)\1/p' cont.c gc.c thread*c vm*.c) \
 	} | \
diff --git a/tool/leaked-globals b/tool/leaked-globals
index ec11621..0fb9e65 100755
--- a/tool/leaked-globals
+++ b/tool/leaked-globals
@@ -21,10 +21,10 @@ print "Checking leaked global symbols..." https://github.com/ruby/ruby/blob/trunk/tool/leaked-globals#L21
 STDOUT.flush
 IO.foreach("|#{NM} -Pgp #{ARGV.join(' ')}") do |line|
   n, t, = line.split
-  next unless /[BDT]/ =~ t
+  next unless /[A-TV-Z]/ =~ t
   next unless n.sub!(/^#{SYMBOL_PREFIX}/o, "")
   next if n.include?(".")
-  next if /\A(?:Init_|InitVM_|ruby_|rb_|[Oo]nig|dln_|mjit_|coroutine_|nu(?:comp|rat)_)/ =~ n
+  next if /\A(?:Init_|InitVM_|RUBY_|ruby_|rb_|[Oo]nig|dln_|mjit_|coroutine_|nu(?:comp|rat)_)/ =~ n
   next if REPLACE.include?(n)
   puts col.fail("leaked") if count.zero?
   count += 1
-- 
cgit v0.10.2


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

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