From patchwork Sat Oct 14 20:35:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3/8] Correctly check for arm condition codes when trying to filter out 'bic' X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 63939 Message-Id: <1508013322-19428-3-git-send-email-martin@martin.st> To: libav-devel@libav.org Date: Sat, 14 Oct 2017 23:35:17 +0300 From: Martin Storsjo List-Id: libav development Since an empty condition code also is valid, this also matched for any other string, since it matched the empty string. By making sure the pattern matches the full string, we avoid that issue. Thanks to the later is_arm_register check, this slipped through earlier. --- gas-preprocessor.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl index 2c9cd07..09fcf0e 100755 --- a/gas-preprocessor.pl +++ b/gas-preprocessor.pl @@ -704,7 +704,7 @@ sub handle_serialized_line { my $cond = $3; my $label = $4; # Don't interpret e.g. bic as b with ic as conditional code - if ($cond =~ /|$arm_cond_codes/) { + if ($cond =~ /^(|$arm_cond_codes)$/) { if (exists $thumb_labels{$label}) { print ASMFILE ".thumb_func $label\n"; } else { @@ -871,7 +871,7 @@ sub handle_serialized_line { my $width = $4; my $target = $5; # Don't interpret e.g. bic as b with ic as conditional code - if ($cond !~ /|$arm_cond_codes/) { + if ($cond !~ /^(|$arm_cond_codes)$/) { # Not actually a branch } elsif ($target =~ /^(\d+)([bf])$/) { # The target is a local label