summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2015-10-12 20:45:05 +0000
committerMarshall Clow <mclow.lists@gmail.com>2015-10-12 20:45:05 +0000
commit8ebfb60efa77062d12a3ecc804b8b52737b7ac1c (patch)
tree95e9fa8d048f63502617e18c24b2782f28e6c030
parentbb3c33609b2d1d7f999446fc27f209e90021268c (diff)
downloadbcm5719-llvm-8ebfb60efa77062d12a3ecc804b8b52737b7ac1c.tar.gz
bcm5719-llvm-8ebfb60efa77062d12a3ecc804b8b52737b7ac1c.zip
Fix Bug 25103 - _cxa_demangle improperly demangles virtual thunks. Thanks to Jason King for the report and suggested fix
llvm-svn: 250097
-rw-r--r--libcxxabi/src/cxa_demangle.cpp2
-rw-r--r--libcxxabi/test/test_demangle.pass.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/libcxxabi/src/cxa_demangle.cpp b/libcxxabi/src/cxa_demangle.cpp
index e6bf1675a2f..f1ad815ac4a 100644
--- a/libcxxabi/src/cxa_demangle.cpp
+++ b/libcxxabi/src/cxa_demangle.cpp
@@ -4415,7 +4415,7 @@ parse_special_name(const char* first, const char* last, C& db)
{
if (db.names.empty())
return first;
- if (first[2] == 'v')
+ if (first[1] == 'v')
{
db.names.back().first.insert(0, "virtual thunk to ");
first = t;
diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp
index 7e845b10bfe..dd6f81e0e3f 100644
--- a/libcxxabi/test/test_demangle.pass.cpp
+++ b/libcxxabi/test/test_demangle.pass.cpp
@@ -29594,6 +29594,8 @@ const char* cases[][2] =
{"_Zli2_xy", "operator\"\" _x(unsigned long long)"},
{"_Z1fIiEDcT_", "decltype(auto) f<int>(int)"},
{"_ZZ4testvEN1g3fooE5Point", "test()::g::foo(Point)"},
+ {"_ZThn12_NSt9strstreamD0Ev", "non-virtual thunk to std::strstream::~strstream()"},
+ {"_ZTv0_n12_NSt9strstreamD0Ev", "virtual thunk to std::strstream::~strstream()"},
};
const unsigned N = sizeof(cases) / sizeof(cases[0]);
OpenPOWER on IntegriCloud