diff options
Diffstat (limited to 'tool/leaked-globals')
-rwxr-xr-x | tool/leaked-globals | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tool/leaked-globals b/tool/leaked-globals index 367d35ab86..87089ebd81 100755 --- a/tool/leaked-globals +++ b/tool/leaked-globals @@ -11,11 +11,14 @@ until ARGV.empty? platform = $1 when /\A SOEXT=(.+)?/x soext = $1 + when /\A SYMBOLS_IN_EMPTYLIB=(.*)/x + SYMBOLS_IN_EMPTYLIB = $1.split(" ") else break end ARGV.shift end +SYMBOLS_IN_EMPTYLIB ||= nil config = ARGV.shift count = 0 @@ -67,7 +70,6 @@ IO.foreach("|#{NM} #{ARGV.join(' ')}") do |line| next unless n.sub!(/^#{SYMBOL_PREFIX}/o, "") next if n.include?(".") next if !so and n.start_with?("___asan_") - case n; when "_init", "_fini"; next end case n when /\A(?:Init_|InitVM_|pm_|[Oo]nig|dln_|coroutine_)/ next @@ -75,6 +77,8 @@ IO.foreach("|#{NM} #{ARGV.join(' ')}") do |line| next unless so when /\A(?:RUBY_|ruby_|rb_)/ next unless so and /_(threadptr|ec)_/ =~ n + when *SYMBOLS_IN_EMPTYLIB + next end next if REPLACE.include?(n) puts col.fail("leaked") if count.zero? |