PR23939, Check frch_cfi_data before use
authorwu.heng <wu.heng@zte.com.cn>
Mon, 3 Dec 2018 02:02:13 +0000 (12:32 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 4 Dec 2018 06:06:30 +0000 (16:36 +1030)
PR 23939
* dw2gencfi.c (dot_cfi_label): Check frch_cfi_data is non-NULL
before use.

gas/ChangeLog
gas/dw2gencfi.c

index ba4aa15c03f14a336cc6be0a69e9c4c3fb098d66..dbb8a379c0ba306a6b7173c02477265558016220 100644 (file)
@@ -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.
index 3b610708022645d2544175cf53d19f4ced4fa8df..4add17356322204236229f9af85ac07c9cfb2ace 100644 (file)
@@ -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;
 
This page took 0.028135 seconds and 4 git commands to generate.