mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-26 13:10:34 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91046 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3472ae1e7b
commit
f05e45eb37
@ -76,7 +76,7 @@ class FilenameCache {
|
||||
public:
|
||||
const char *getFilename(MDNode *Scope) {
|
||||
std::string &Filename = Filenames[Scope];
|
||||
if (Filename == NULL) {
|
||||
if (Filename.empty()) {
|
||||
DIScope S(Scope);
|
||||
Filename = S.getFilename();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user