diff libiberty/cp-demint.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents a06113de4d67
children 84e7813d76e9
line wrap: on
line diff
--- a/libiberty/cp-demint.c	Sun Aug 21 07:07:55 2011 +0900
+++ b/libiberty/cp-demint.c	Fri Oct 27 22:46:09 2017 +0900
@@ -1,5 +1,5 @@
 /* Demangler component interface functions.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004-2017 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@wasabisystems.com>.
 
    This file is part of the libiberty library, which is part of GCC.
@@ -106,10 +106,12 @@
     case DEMANGLE_COMPONENT_CONST_THIS:
     case DEMANGLE_COMPONENT_POINTER:
     case DEMANGLE_COMPONENT_REFERENCE:
+    case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
     case DEMANGLE_COMPONENT_COMPLEX:
     case DEMANGLE_COMPONENT_IMAGINARY:
     case DEMANGLE_COMPONENT_VENDOR_TYPE:
     case DEMANGLE_COMPONENT_CAST:
+    case DEMANGLE_COMPONENT_CONVERSION:
       if (right != NULL)
 	return 0;
       break;
@@ -122,6 +124,7 @@
   p->type = type;
   p->u.s_binary.left = left;
   p->u.s_binary.right = right;
+  p->d_printing = 0;
 
   return 1;
 }
@@ -145,6 +148,7 @@
 	{
 	  p->type = DEMANGLE_COMPONENT_BUILTIN_TYPE;
 	  p->u.s_builtin.type = &cplus_demangle_builtin_types[i];
+	  p->d_printing = 0;
 	  return 1;
 	}
     }
@@ -171,6 +175,7 @@
 	{
 	  p->type = DEMANGLE_COMPONENT_OPERATOR;
 	  p->u.s_operator.op = &cplus_demangle_operators[i];
+	  p->d_printing = 0;
 	  return 1;
 	}
     }
@@ -206,10 +211,8 @@
 	     malloc (di.num_subs * sizeof (struct demangle_component *)));
   if (di.comps == NULL || di.subs == NULL)
     {
-      if (di.comps != NULL)
-	free (di.comps);
-      if (di.subs != NULL)
-	free (di.subs);
+      free (di.comps);
+      free (di.subs);
       return NULL;
     }