diff options
Diffstat (limited to 'libpp/parse_filename.cpp')
-rw-r--r-- | libpp/parse_filename.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libpp/parse_filename.cpp b/libpp/parse_filename.cpp index 65422cb..3346d56 100644 --- a/libpp/parse_filename.cpp +++ b/libpp/parse_filename.cpp @@ -82,6 +82,13 @@ string const parse_anon(string const & str, string const & str2) string name = str2; // Get rid of "{anon: name.erase(0, 6); + // Catch the case where we end up with an empty string. This should + // never happen, except where things have gone awfully bad with profile + // data collection, resulting in one or more bogus sample files. + if(0 == name.size()) + throw invalid_argument("parse_anon() invalid name: " + str2 + "\n" + + "This error indicates your sample data is suspect. It is " + + "recommended you do a --reset and collect new profile data."); // Get rid of the trailing '}' name.erase(name.size() - 1, 1); vector<string> parts = separate_token(str, '.'); |