d_add_substitution can fail for various reasons, like when the subs array
is full. If d_add_substitution fails d_substitution should return NULL
early and not try to continue. Every other call of d_add_substitution
is handled in the same way.
libiberty/ChangeLog:
* cp-demangle.c (d_substitution): Return NULL if d_add_substitution
fails.
From-SVN: r247055
+2017-04-21 Mark Wielaard <mark@klomp.org>
+
+ * cp-demangle.c (d_substitution): Return NULL if d_add_substitution
+ fails.
+
2017-04-21 Mark Wielaard <mark@klomp.org>
* cp-demangle.h (struct d_info): Remove did_subs field.
/* If there are ABI tags on the abbreviation, it becomes
a substitution candidate. */
dc = d_abi_tags (di, dc);
- d_add_substitution (di, dc);
+ if (! d_add_substitution (di, dc))
+ return NULL;
}
return dc;
}