Since we're doing a replace of a string that looks like e.g "1b"
over a full line, such a string could concievably be a substring of
another identifier as well.

This doesn't fix any known issue, but attempts to make this
less fragile.
---
 gas-preprocessor.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index 09fcf0e..fe9c746 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -631,12 +631,12 @@ sub handle_local_label {
     my $dir  = $_[2];
     my $target = "$num$dir";
     if ($dir eq "b") {
-        $line =~ s/$target/$last_temp_labels{$num}/g;
+        $line =~ s/\b$target\b/$last_temp_labels{$num}/g;
     } else {
         my $name = "temp_label_$temp_label_next";
         $temp_label_next++;
         push(@{$next_temp_labels{$num}}, $name);
-        $line =~ s/$target/$name/g;
+        $line =~ s/\b$target\b/$name/g;
     }
     return $line;
 }
-- 
2.7.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to