Module: gas-preprocessor Branch: master Commit: d0c3a3c6c66bfe580c450efa0481495cb6e72500
Author: Martin Storsjo <[email protected]> Committer: Martin Storsjo <[email protected]> Date: Fri Oct 13 22:11:48 2017 +0300 Require boundaries around local labels in handle_local_label 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; } _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
