aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwu.heng <wu.heng@zte.com.cn>2018-12-03 12:32:13 +1030
committerAlan Modra <amodra@gmail.com>2018-12-04 16:36:30 +1030
commit314a80c41d52737c9cfdc80dc2f6f56e0d5cfd96 (patch)
tree7de1c978ce7fe3e89adf21ee837345c97775fd8e
parentb90514cfb5e1f9dcc2c0b89e22b65dd6c7879564 (diff)
downloadgdb-314a80c41d52737c9cfdc80dc2f6f56e0d5cfd96.zip
gdb-314a80c41d52737c9cfdc80dc2f6f56e0d5cfd96.tar.gz
gdb-314a80c41d52737c9cfdc80dc2f6f56e0d5cfd96.tar.bz2
PR23939, Check frch_cfi_data before use
PR 23939 * dw2gencfi.c (dot_cfi_label): Check frch_cfi_data is non-NULL before use.
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/dw2gencfi.c10
2 files changed, 15 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ba4aa15..dbb8a37 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2018-12-04 wu.heng <wu.heng@zte.com.cn>
+
+ PR 23939
+ * dw2gencfi.c (dot_cfi_label): Check frch_cfi_data is non-NULL
+ before use.
+
2018-12-03 Kito Cheng <kito@andestech.com>
* config/tc-riscv.c: Include elfxx-riscv.h.
diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c
index 3b61070..4add173 100644
--- a/gas/dw2gencfi.c
+++ b/gas/dw2gencfi.c
@@ -1198,8 +1198,16 @@ dot_cfi_val_encoded_addr (int ignored ATTRIBUTE_UNUSED)
static void
dot_cfi_label (int ignored ATTRIBUTE_UNUSED)
{
- char *name = read_symbol_name ();
+ char *name;
+
+ if (frchain_now->frch_cfi_data == NULL)
+ {
+ as_bad (_("CFI instruction used without previous .cfi_startproc"));
+ ignore_rest_of_line ();
+ return;
+ }
+ name = read_symbol_name ();
if (name == NULL)
return;