From 1a7afd9a9cdba83fe79d06b5f92efeebc1ea1971 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 14 Apr 2020 20:37:03 +0000 Subject: Fix a crash in find_bug_matches --- autobuild.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/autobuild.rb b/autobuild.rb index 89a98bf..7b0c8d5 100755 --- a/autobuild.rb +++ b/autobuild.rb @@ -157,11 +157,15 @@ def find_bug_matches(build_dir) # loop over file File.open(build_file).each_line do |li| - if any_bug_re.match(li) then - # loop over individual regexes to find the matching one - regex_list.each do |regex| - return $bug_matches[regex] if (/#{regex}/.match(li)) + begin + if any_bug_re.match(li) then + # loop over individual regexes to find the matching one + regex_list.each do |regex| + return $bug_matches[regex] if (/#{regex}/.match(li)) + end end + rescue ArgumentError => e + # Some lines have invalid UTF-8, just ignore them end end return '' -- cgit v1.2.1