[AArch64,GAS] Fix unintialized variable which can cause diagnostic failures.

Message ID 20180521130406.GA32237@arm.com
State New
Headers show
Series
  • [AArch64,GAS] Fix unintialized variable which can cause diagnostic failures.
Related show

Commit Message

Tamar Christina May 21, 2018, 1:04 p.m.
Hi All,

This patch fixes an uninitialized memory issue that can under certain
circumstances turn an error into a warning because non_fatal was not initialised
in all cases.

Verified using valgrind.

bootstrapped and regtested on
  aarch64-none-elf, aarch64-none-elf (32 bit host),
  aarch64-none-linux-gnu, aarch64_be-none-linux-gnu

Cross-compiled and regtested on
  aarch64-none-linux-gnu, aarch64_be-none-linux-gnu

and no issues.

Ok for master?

Thanks,
Tamar

gas/config/tc-aarch64.c
2018-05-21  Tamar Christina  <tamar.christina@arm.com>

	PR binutils/21446
	* tc-aarch64.c (record_operand_error, record_operand_error_with_data):
	  Initialize non_fatal.

--

Comments

Nick Clifton June 1, 2018, 7:28 a.m. | #1
Hi Tamar,

> gas/config/tc-aarch64.c

> 2018-05-21  Tamar Christina  <tamar.christina@arm.com>

> 

> 	PR binutils/21446

> 	* tc-aarch64.c (record_operand_error, record_operand_error_with_data):

> 	  Initialize non_fatal.


Approved - please apply.

Cheers
  Nick

Patch

diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index b007fb33b5cece4f1590c877751f78b046881835..3cf246f0d70f2e37d7d664ca32ddab1777789dda 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -4400,6 +4400,7 @@  record_operand_error (const aarch64_opcode *opcode, int idx,
   info.index = idx;
   info.kind = kind;
   info.error = error;
+  info.non_fatal = FALSE;
   record_operand_error_info (opcode, &info);
 }
 
@@ -4415,6 +4416,7 @@  record_operand_error_with_data (const aarch64_opcode *opcode, int idx,
   info.data[0] = extra_data[0];
   info.data[1] = extra_data[1];
   info.data[2] = extra_data[2];
+  info.non_fatal = FALSE;
   record_operand_error_info (opcode, &info);
 }