Comparing std::string with NULL is a bad idea, so just check whether its empty.
This code was crashing always with oprofile enabled, since it tried to create a StringRef out of NULL, which run strlen on NULL. llvm-svn: 91046
This commit is contained in:
parent
84d8767c15
commit
12b8a63e13
|
@ -76,7 +76,7 @@ class FilenameCache {
|
||||||
public:
|
public:
|
||||||
const char *getFilename(MDNode *Scope) {
|
const char *getFilename(MDNode *Scope) {
|
||||||
std::string &Filename = Filenames[Scope];
|
std::string &Filename = Filenames[Scope];
|
||||||
if (Filename == NULL) {
|
if (Filename.empty()) {
|
||||||
DIScope S(Scope);
|
DIScope S(Scope);
|
||||||
Filename = S.getFilename();
|
Filename = S.getFilename();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue