[ItaniumDemangle] Fix a exponential string copying bug

This is a port of libcxxabi's r304113.

llvm-svn: 304114
This commit is contained in:
Erik Pilkington 2017-05-28 23:24:52 +00:00
parent a34ea7583f
commit de83eea576
1 changed files with 3 additions and 0 deletions

View File

@ -2525,6 +2525,9 @@ static std::string base_name(std::string &s) {
++p0;
break;
}
if (!isalpha(*p0) && !isdigit(*p0) && *p0 != '_') {
return std::string();
}
}
return std::string(p0, pe);
}