From 98bb7ee2da460526effb6cdfcdd242ebe247d7b5 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Mon, 1 May 2017 10:50:58 +0000 Subject: [PATCH] d-demangle.c (dlang_parse_symbol): Skip over anonymous symbols. libiberty/ChangeLog: * d-demangle.c (dlang_parse_symbol): Skip over anonymous symbols. * testsuite/d-demangle-expected: Add tests. From-SVN: r247434 --- libiberty/ChangeLog | 7 ++++++- libiberty/d-demangle.c | 4 ++++ libiberty/testsuite/d-demangle-expected | 8 ++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 7aa4821d610..c5c566d83bc 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,4 +1,9 @@ -2017-04-15 Iain Buclaw +2017-05-01 Iain Buclaw + + * d-demangle.c (dlang_parse_symbol): Skip over anonymous symbols. + * testsuite/d-demangle-expected: Add tests. + +2017-05-01 Iain Buclaw * d-demangle.c (dlang_identifier): Handle template constraint symbols. (dlang_parse_template): Only advance if template symbol prefix is diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c index 74dde9d9b0c..533653fde2f 100644 --- a/libiberty/d-demangle.c +++ b/libiberty/d-demangle.c @@ -1362,6 +1362,10 @@ dlang_parse_symbol (string *decl, const char *mangled, if (n++) string_append (decl, "."); + /* Skip over anonymous symbols. */ + while (*mangled == '0') + mangled++; + mangled = dlang_identifier (decl, mangled, kind); if (mangled && dlang_call_convention_p (mangled)) diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected index 6725684ff33..530e0e62bff 100644 --- a/libiberty/testsuite/d-demangle-expected +++ b/libiberty/testsuite/d-demangle-expected @@ -929,6 +929,14 @@ demangle.test(char() delegate shared inout) _D8demangle4testFDONgxFZaZv demangle.test(char() delegate shared inout const) # +--format=dlang +_D8demangle004testFaZv +demangle.test(char) +# +--format=dlang +_D8demangle000000004testFaZv +demangle.test(char) +# # Unittests # --format=dlang -- 2.30.2