[5/8] Operate on the right variable instead of the implicit variable

Message ID 1508013322-19428-5-git-send-email-martin@martin.st
State Committed
Headers show

Commit Message

Martin Storsjö Oct. 14, 2017, 8:35 p.m.
Apparently, this hasn't caused any issues in practice.
---
 gas-preprocessor.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Janne Grunau Oct. 18, 2017, 6:15 a.m. | #1
On 2017-10-14 23:35:19 +0300, Martin Storsjö wrote:
> Apparently, this hasn't caused any issues in practice.
> ---
>  gas-preprocessor.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
> index fe9c746..456ee24 100755
> --- a/gas-preprocessor.pl
> +++ b/gas-preprocessor.pl
> @@ -943,7 +943,7 @@ sub handle_serialized_line {
>          # Convert "mov pc, lr" into "bx lr", since the former only works
>          # for switching from arm to thumb (and only in armv7), but not
>          # from thumb to arm.
> -        s/mov\s*pc\s*,\s*lr/bx lr/g;
> +        $line =~ s/mov\s*pc\s*,\s*lr/bx lr/g;
>  
>          # Convert stmdb/ldmia/stmfd/ldmfd/ldm with only one register into a plain str/ldr with post-increment/decrement.
>          # Wide thumb2 encoding requires at least two registers in register list while all other encodings support one register too.

ok

Janne

Patch

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index fe9c746..456ee24 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -943,7 +943,7 @@  sub handle_serialized_line {
         # Convert "mov pc, lr" into "bx lr", since the former only works
         # for switching from arm to thumb (and only in armv7), but not
         # from thumb to arm.
-        s/mov\s*pc\s*,\s*lr/bx lr/g;
+        $line =~ s/mov\s*pc\s*,\s*lr/bx lr/g;
 
         # Convert stmdb/ldmia/stmfd/ldmfd/ldm with only one register into a plain str/ldr with post-increment/decrement.
         # Wide thumb2 encoding requires at least two registers in register list while all other encodings support one register too.