mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update leaked-globals [Bug #16934]
* match uppercase types which would be global, other than [BDT] * ignore `RUBY_` prefixed symbols
This commit is contained in:
parent
047471c529
commit
2b7454eb92
2 changed files with 3 additions and 3 deletions
|
@ -356,7 +356,7 @@ $(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A)
|
||||||
ruby.imp: $(COMMONOBJS)
|
ruby.imp: $(COMMONOBJS)
|
||||||
$(Q){ \
|
$(Q){ \
|
||||||
$(NM) -Pgp $(COMMONOBJS) | \
|
$(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) && \
|
($(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) \
|
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) \
|
||||||
} | \
|
} | \
|
||||||
|
|
|
@ -21,10 +21,10 @@ print "Checking leaked global symbols..."
|
||||||
STDOUT.flush
|
STDOUT.flush
|
||||||
IO.foreach("|#{NM} -Pgp #{ARGV.join(' ')}") do |line|
|
IO.foreach("|#{NM} -Pgp #{ARGV.join(' ')}") do |line|
|
||||||
n, t, = line.split
|
n, t, = line.split
|
||||||
next unless /[BDT]/ =~ t
|
next unless /[A-TV-Z]/ =~ t
|
||||||
next unless n.sub!(/^#{SYMBOL_PREFIX}/o, "")
|
next unless n.sub!(/^#{SYMBOL_PREFIX}/o, "")
|
||||||
next if n.include?(".")
|
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)
|
next if REPLACE.include?(n)
|
||||||
puts col.fail("leaked") if count.zero?
|
puts col.fail("leaked") if count.zero?
|
||||||
count += 1
|
count += 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue