[libcxxabi] r309650 - [demangler] Fix another bug found by oss-fuzz in r309340
Erik Pilkington via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 31 19:38:41 PDT 2017
Author: epilk
Date: Mon Jul 31 19:38:41 2017
New Revision: 309650
URL: http://llvm.org/viewvc/llvm-project?rev=309650&view=rev
Log:
[demangler] Fix another bug found by oss-fuzz in r309340
Modified:
libcxxabi/trunk/src/cxa_demangle.cpp
libcxxabi/trunk/test/test_demangle.pass.cpp
Modified: libcxxabi/trunk/src/cxa_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=309650&r1=309649&r2=309650&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_demangle.cpp (original)
+++ libcxxabi/trunk/src/cxa_demangle.cpp Mon Jul 31 19:38:41 2017
@@ -5867,6 +5867,8 @@ parse_encoding(const char* first, const
if (t != last && *t == 'v')
{
++t;
+ if (db.names.empty())
+ return first;
Node* name = db.names.back();
db.names.pop_back();
result = db.make<TopLevelFunctionDecl>(
Modified: libcxxabi/trunk/test/test_demangle.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/test_demangle.pass.cpp?rev=309650&r1=309649&r2=309650&view=diff
==============================================================================
--- libcxxabi/trunk/test/test_demangle.pass.cpp (original)
+++ libcxxabi/trunk/test/test_demangle.pass.cpp Mon Jul 31 19:38:41 2017
@@ -29676,6 +29676,7 @@ const char* invalid_cases[] =
"AT__ZSiIJEEAnwscT_T__",
"FSiIJEENT_IoE ",
"ZTVSiIZTVSiIZTVSiIZTVSiINIJEET_T_T_T_T_ ",
+ "_ZSiIJEvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvttvvvvvvET_v",
};
const unsigned NI = sizeof(invalid_cases) / sizeof(invalid_cases[0]);
More information about the cfe-commits
mailing list