aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2021-09-06 10:52:49 +0100
committerNick Clifton <nickc@redhat.com>2021-09-06 10:52:49 +0100
commit1bced5243e82e7a30f415a999c136997d7a79934 (patch)
treea4f9707344e29ea0ae0233c80634560077965e2f /gas
parent1faddd8d18c6a1c01f1bdd5ea528e3bcff3897ce (diff)
downloadbinutils-1bced5243e82e7a30f415a999c136997d7a79934.zip
binutils-1bced5243e82e7a30f415a999c136997d7a79934.tar.gz
binutils-1bced5243e82e7a30f415a999c136997d7a79934.tar.bz2
Fix potential use on an uninitialised vairable in the MCore assembler.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-mcore.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c
index 443253f..d030b6f 100644
--- a/gas/config/tc-mcore.c
+++ b/gas/config/tc-mcore.c
@@ -852,7 +852,7 @@ md_assemble (char * str)
char * op_start;
char * op_end;
mcore_opcode_info * opcode;
- char * output;
+ char * output = NULL;
int nlen = 0;
unsigned short inst;
unsigned reg;
@@ -1596,8 +1596,11 @@ md_assemble (char * str)
if (strcmp (op_end, opcode->name) && strcmp (op_end, ""))
as_warn (_("ignoring operands: %s "), op_end);
- output[0] = INST_BYTE0 (inst);
- output[1] = INST_BYTE1 (inst);
+ if (output != NULL)
+ {
+ output[0] = INST_BYTE0 (inst);
+ output[1] = INST_BYTE1 (inst);
+ }
#ifdef OBJ_ELF
dwarf2_emit_insn (2);