summaryrefslogtreecommitdiffstats
path: root/library/preprocessor.cpp
diff options
context:
space:
mode:
authorAlpha <ngcoder@live.com>2015-11-25 23:22:11 -0500
committerAlpha <ngcoder@live.com>2015-11-25 23:22:11 -0500
commit72fd472418967f1f9d4f8c9f066cffba74e72d10 (patch)
treea06cd92fd8dd1e7060def5e77d91a45ad978267e /library/preprocessor.cpp
parent2f6aa56949c910ad5e09c78b4f09c3d9d9e74b3e (diff)
downloadwebgrind-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.cpp5
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
+ }
}
}