diff options
author | Alpha <ngcoder@live.com> | 2015-11-25 23:22:11 -0500 |
---|---|---|
committer | Alpha <ngcoder@live.com> | 2015-11-25 23:22:11 -0500 |
commit | 72fd472418967f1f9d4f8c9f066cffba74e72d10 (patch) | |
tree | a06cd92fd8dd1e7060def5e77d91a45ad978267e /library/preprocessor.cpp | |
parent | 2f6aa56949c910ad5e09c78b4f09c3d9d9e74b3e (diff) | |
download | webgrind-72fd472418967f1f9d4f8c9f066cffba74e72d10.zip webgrind-72fd472418967f1f9d4f8c9f066cffba74e72d10.tar.gz webgrind-72fd472418967f1f9d4f8c9f066cffba74e72d10.tar.bz2 |
Safegaurd against error on miss-parse of compressed name, fixes #2
What situation can produce this?
Diffstat (limited to 'library/preprocessor.cpp')
-rw-r--r-- | library/preprocessor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/library/preprocessor.cpp b/library/preprocessor.cpp index 6c15cf6..31614f3 100644 --- a/library/preprocessor.cpp +++ b/library/preprocessor.cpp @@ -288,7 +288,10 @@ private: name.erase(0, idx + 2); compressedNames[isFile][functionIndex] = name; } else { - name = compressedNames[isFile][functionIndex]; + std::map<int, std::string>::iterator nmIt = compressedNames[isFile].find(functionIndex); + if (nmIt != compressedNames[isFile].end()) { + name = nmIt->second; // should always exist for valid files + } } } |