[GASPP,1/2] Fix the regexp used for replacing .align

Message ID 1539983272-802-1-git-send-email-martin@martin.st
State New
Headers show
Series
  • [GASPP,1/2] Fix the regexp used for replacing .align
Related show

Commit Message

Martin Storsjö Oct. 19, 2018, 9:07 p.m.
The condition above allows multiple spaces, but the actual replacement
only allowed one space.
---
 gas-preprocessor.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luca Barbato Oct. 22, 2018, 3:46 p.m. | #1
On 19/10/2018 23:07, Martin Storsjo wrote:
> The condition above allows multiple spaces, but the actual replacement
> only allowed one space.
> ---
>  gas-preprocessor.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
> index c56301c..b22ee8a 100755
> --- a/gas-preprocessor.pl
> +++ b/gas-preprocessor.pl
> @@ -922,7 +922,7 @@ sub handle_serialized_line {
>          # ALIGN in armasm syntax is the actual number of bytes
>          if ($line =~ /\.(?:p2)?align\s+(\d+)/) {
>              my $align = 1 << $1;
> -            $line =~ s/\.(?:p2)?align\s(\d+)/ALIGN $align/;
> +            $line =~ s/\.(?:p2)?align\s+(\d+)/ALIGN $align/;
>          }
>          # Convert gas style [r0, :128] into armasm [r0@128] alignment specification
>          $line =~ s/\[([^\[,]+),?\s*:(\d+)\]/[$1\@$2]/g;
> 

I guess it is fine.

Patch

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index c56301c..b22ee8a 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -922,7 +922,7 @@  sub handle_serialized_line {
         # ALIGN in armasm syntax is the actual number of bytes
         if ($line =~ /\.(?:p2)?align\s+(\d+)/) {
             my $align = 1 << $1;
-            $line =~ s/\.(?:p2)?align\s(\d+)/ALIGN $align/;
+            $line =~ s/\.(?:p2)?align\s+(\d+)/ALIGN $align/;
         }
         # Convert gas style [r0, :128] into armasm [r0@128] alignment specification
         $line =~ s/\[([^\[,]+),?\s*:(\d+)\]/[$1\@$2]/g;