Skip to contentSkip to conversation

target/hexagon/idef-parser: Remove self-assignment

PATCH In review Anton Johansson via 5 participants 5 messages Jul 13, 2023 – Jul 31, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/hexagon/idef-parser: Remove self-assignment

The self assignment is clearly useless, and @1.last_column does not have to be set for an expression with only a single token, so remove it.

---
 target/hexagon/idef-parser/idef-parser.y | 1 -
 1 file changed, 1 deletion(-)
target/hexagon/idef-parser/idef-parser.y +0 -1
index cd2612eb8c..a6587f5bcc 100644
@@ -802,7 +802,6 @@ rvalue : FAIL
 
 lvalue : FAIL
          {
-             @1.last_column = @1.last_column;
              yyassert(c, &@1, false, "Encountered a FAIL token as lvalue.\n");
          }
        | REG
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to Anton Johansson via
Quoted 35 lines

-----Original Message-----
From: Anton Johansson <[email protected]>
Sent: Thursday, July 13, 2023 7:09 AM
To: [email protected]
Cc: Brian Cain <[email protected]>; [email protected]
Subject: [PATCH] target/hexagon/idef-parser: Remove self-assignment

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

The self assignment is clearly useless, and @1.last_column does not have to be set for an expression with only a single token, so remove it.

---
 target/hexagon/idef-parser/idef-parser.y | 1 -
 1 file changed, 1 deletion(-)
target/hexagon/idef- renamed from target/hexagon/idef-parser/idef-parser.y +0 -0

parser/idef-parser.y
index cd2612eb8c..a6587f5bcc 100644

target/hexagon/idef-parser/idef-parser.y +0 -2
@@ -802,7 +802,6 @@ rvalue : FAIL
 
 lvalue : FAIL
          {
-             @1.last_column = @1.last_column;
              yyassert(c, &@1, false, "Encountered a FAIL token as lvalue.\n");
          }
        | REG
--
Quoted 1 line

2.41.0

#3 lore raw
Quoted 29 lines · Brian Cain
Quoted 29 lines

-----Original Message-----
From: Anton Johansson <[email protected]>
Sent: Thursday, July 13, 2023 7:09 AM
To: [email protected]
Cc: Brian Cain <[email protected]>; [email protected]
Subject: [PATCH] target/hexagon/idef-parser: Remove self-assignment

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

The self assignment is clearly useless, and @1.last_column does not have to be set for an expression with only a single token, so remove it.

---
 target/hexagon/idef-parser/idef-parser.y | 1 -
 1 file changed, 1 deletion(-)
target/hexagon/idef- renamed from target/hexagon/idef-parser/idef-parser.y +0 -0

parser/idef-parser.y
index cd2612eb8c..a6587f5bcc 100644

target/hexagon/idef-parser/idef-parser.y +0 -0
@@ -802,7 +802,6 @@ rvalue : FAIL
 
Quoted 10 lines
Quoted 8 lines
target/hexagon/idef-parser/idef-parser.y +0 -2
 lvalue : FAIL
          {
-             @1.last_column = @1.last_column;
              yyassert(c, &@1, false, "Encountered a FAIL token as lvalue.\n");
          }
        | REG
--

2.41.0

Ping -- I just noticed that this patch never seems to have made it upstream. Brian, could you pick it up?

(This fixes a Coverity issue: CID 976926.)

thanks
-- PMM

#4 lore raw
Quoted 39 lines · Peter Maydell
Quoted 28 lines · Brian Cain
Quoted 28 lines

-----Original Message-----
From: Anton Johansson <[email protected]>
Sent: Thursday, July 13, 2023 7:09 AM
To: [email protected]
Cc: Brian Cain <[email protected]>; [email protected]
Subject: [PATCH] target/hexagon/idef-parser: Remove self-assignment

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

The self assignment is clearly useless, and @1.last_column does not have to be set for an expression with only a single token, so remove it.

---
  target/hexagon/idef-parser/idef-parser.y | 1 -
  1 file changed, 1 deletion(-)
target/hexagon/idef- renamed from target/hexagon/idef-parser/idef-parser.y +0 -0

parser/idef-parser.y
index cd2612eb8c..a6587f5bcc 100644

target/hexagon/idef-parser/idef-parser.y +0 -0
@@ -802,7 +802,6 @@ rvalue : FAIL
 
Quoted 9 lines
Quoted 8 lines
target/hexagon/idef-parser/idef-parser.y +0 -2
  lvalue : FAIL
           {
-             @1.last_column = @1.last_column;
               yyassert(c, &@1, false, "Encountered a FAIL token as lvalue.\n");
           }
         | REG
--

2.41.0

Quoted 4 lines

Ping -- I just noticed that this patch never seems to have made it upstream. Brian, could you pick it up?

(This fixes a Coverity issue: CID 976926.)

Sorry about that!  Queued at https://github.com/quic/qemu/ hex.next -- will include it in an upcoming PR.