Merge libiberty: Initialize d_printing in all cplus_demangle_fill_* functions.
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Mar 2017 18:26:47 +0000 (18:26 +0000)
committerMark Wielaard <mark@klomp.org>
Mon, 13 Mar 2017 19:51:42 +0000 (20:51 +0100)
While integrating the d_printing recursion guard change into gdb I
noticed we forgot to initialize the demangle_component d_printing
field in cplus_demangle_fill_{name,extended_operator,ctor,dtor}.
As is done in cplus_demangle_fill_{component,builtin_type,operator}.
It happened to work because in gcc all demangle_components were
allocated through d_make_empty. But gdb has its own allocation
mechanism (as might other users).

libiberty/ChangeLog:

       * cp-demangle.c (cplus_demangle_fill_name): Initialize
       demangle_component d_printing.
       (cplus_demangle_fill_extended_operator): Likewise.
       (cplus_demangle_fill_ctor): Likewise.
       (cplus_demangle_fill_dtor): Likewise.

gdb/ChangeLog:

       * cp-name-parser.y (make_empty): Initialize d_printing to zero.

gdb/ChangeLog
gdb/cp-name-parser.y
libiberty/ChangeLog
libiberty/cp-demangle.c

index e4c44324fc2ca78d207a56fa388f257677200545..7de2498746365538576d5ab97d3bbf4d484a3f23 100644 (file)
@@ -1,3 +1,7 @@
+2017-03-13  Mark Wielaard  <mark@klomp.org>
+
+       * cp-name-parser.y (make_empty): Initialize d_printing to zero.
+
 2017-03-10  Keith Seitz  <keiths@redhat.com>
 
        PR c++/8218
index fd1e9492778f69decbfa18bd7c331affbc3f12e9..5278c05afe91ef64f4e7b88cecc4a78955537586 100644 (file)
@@ -201,6 +201,7 @@ make_empty (enum demangle_component_type d_type)
 {
   struct demangle_component *ret = d_grab ();
   ret->type = d_type;
+  ret->d_printing = 0;
   return ret;
 }
 
index e93e327749dab56ec6c1b8cab9980289e3a22c1d..b513fcefe3ef2077010b2bdbb8e46bc65692b875 100644 (file)
@@ -1,3 +1,11 @@
+2017-03-12  Mark Wielaard  <mark@klomp.org>
+
+       * cp-demangle.c (cplus_demangle_fill_name): Initialize
+       demangle_component d_printing.
+       (cplus_demangle_fill_extended_operator): Likewise.
+       (cplus_demangle_fill_ctor): Likewise.
+       (cplus_demangle_fill_dtor): Likewise.
+
 2017-03-08  Mark Wielaard  <mark@klomp.org>
 
        PR demangler/70909
index 341a4182c0b69148052c6aa104a29415aca015d3..04832ff6830ab341c63480974dea848ef4c65f4f 100644 (file)
@@ -854,6 +854,7 @@ cplus_demangle_fill_name (struct demangle_component *p, const char *s, int len)
 {
   if (p == NULL || s == NULL || len == 0)
     return 0;
+  p->d_printing = 0;
   p->type = DEMANGLE_COMPONENT_NAME;
   p->u.s_name.s = s;
   p->u.s_name.len = len;
@@ -869,6 +870,7 @@ cplus_demangle_fill_extended_operator (struct demangle_component *p, int args,
 {
   if (p == NULL || args < 0 || name == NULL)
     return 0;
+  p->d_printing = 0;
   p->type = DEMANGLE_COMPONENT_EXTENDED_OPERATOR;
   p->u.s_extended_operator.args = args;
   p->u.s_extended_operator.name = name;
@@ -888,6 +890,7 @@ cplus_demangle_fill_ctor (struct demangle_component *p,
       || (int) kind < gnu_v3_complete_object_ctor
       || (int) kind > gnu_v3_object_ctor_group)
     return 0;
+  p->d_printing = 0;
   p->type = DEMANGLE_COMPONENT_CTOR;
   p->u.s_ctor.kind = kind;
   p->u.s_ctor.name = name;
@@ -907,6 +910,7 @@ cplus_demangle_fill_dtor (struct demangle_component *p,
       || (int) kind < gnu_v3_deleting_dtor
       || (int) kind > gnu_v3_object_dtor_group)
     return 0;
+  p->d_printing = 0;
   p->type = DEMANGLE_COMPONENT_DTOR;
   p->u.s_dtor.kind = kind;
   p->u.s_dtor.name = name;
This page took 0.048045 seconds and 4 git commands to generate.