[GASPP] Use the correct variable $line instead of the implicit variable

Message ID 1540239852-6222-1-git-send-email-martin@martin.st
State New
Headers show
Series
  • [GASPP] Use the correct variable $line instead of the implicit variable
Related show

Commit Message

Martin Storsjö Oct. 22, 2018, 8:24 p.m.
This fixes cases if the input parameter is something else than
the currently iterated variable.
---
 gas-preprocessor.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Janne Grunau Oct. 26, 2018, 8:45 p.m. | #1
On 2018-10-22 23:24:12 +0300, Martin Storsjö wrote:
> This fixes cases if the input parameter is something else than
> the currently iterated variable.
> ---
>  gas-preprocessor.pl | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
> index 41d7b69..39ad08d 100755
> --- a/gas-preprocessor.pl
> +++ b/gas-preprocessor.pl
> @@ -383,12 +383,12 @@ sub parse_line {
>      return if (parse_if_line($line));
>  
>      if (scalar(@rept_lines) == 0) {
> -        if (/\.macro/) {
> +        if ($line =~ /\.macro/) {
>              $macro_level++;
>              if ($macro_level > 1 && !$current_macro) {
>                  die "nested macros but we don't have master macro";
>              }
> -        } elsif (/\.endm/) {
> +        } elsif ($line =~ /\.endm/) {
>              $macro_level--;
>              if ($macro_level < 0) {
>                  die "unmatched .endm";

ok

Janne

Patch

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index 41d7b69..39ad08d 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -383,12 +383,12 @@  sub parse_line {
     return if (parse_if_line($line));
 
     if (scalar(@rept_lines) == 0) {
-        if (/\.macro/) {
+        if ($line =~ /\.macro/) {
             $macro_level++;
             if ($macro_level > 1 && !$current_macro) {
                 die "nested macros but we don't have master macro";
             }
-        } elsif (/\.endm/) {
+        } elsif ($line =~ /\.endm/) {
             $macro_level--;
             if ($macro_level < 0) {
                 die "unmatched .endm";