[binutils-gdb/binutils-2_47-branch] arm: uninitialised exp.X_op

Alan Modra via Binutils-cvs <[email protected]>
Newsgroups gmane.comp.gnu.binutils.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=88125e1b9f385537856c2271e45048ca3b007bce

commit 88125e1b9f385537856c2271e45048ca3b007bce
Author: Alan Modra <[email protected]>
Date:   Mon Aug 10 17:45:00 2026 +0930

    arm: uninitialised exp.X_op
    
            * config/tc-arm.c (my_get_expression): Move initialisation of
            expression before first return from function.
    
    (cherry picked from commit 8e6c4f526a68b796b7bd71d53e4dc459ac56c3ef)

Diff:
---
 gas/config/tc-arm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index ba599ef1fda..c02d3101cc1 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -1141,6 +1141,8 @@ my_get_expression (expressionS * ep, char ** str, int prefix_mode)
 {
   char * save_in;
 
+  memset (ep, 0, sizeof (expressionS));
+
   /* In unified syntax, all prefixes are optional.  */
   if (unified_syntax)
     prefix_mode = (prefix_mode == GE_OPT_PREFIX_BIG) ? prefix_mode
@@ -1166,8 +1168,6 @@ my_get_expression (expressionS * ep, char ** str, int prefix_mode)
       abort ();
     }
 
-  memset (ep, 0, sizeof (expressionS));
-
   save_in = input_line_pointer;
   input_line_pointer = *str;
   in_my_get_expression = true;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.