summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-12-10 10:01:47 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-12-10 10:01:47 +0000
commit12b8a63e13d7bde9a4c2414dd4342abdc16e27ec (patch)
tree266bb0b16ab16b6c0949d355d34de518a603c291 /llvm/lib/ExecutionEngine/JIT
parent84d8767c1582d1ee300ecf9899b76d57a34c3597 (diff)
downloadbcm5719-llvm-12b8a63e13d7bde9a4c2414dd4342abdc16e27ec.tar.gz
bcm5719-llvm-12b8a63e13d7bde9a4c2414dd4342abdc16e27ec.zip
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
Diffstat (limited to 'llvm/lib/ExecutionEngine/JIT')
-rw-r--r--llvm/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp b/llvm/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp
index 076e5a0ce7b..52a8f71ca34 100644
--- a/llvm/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp
@@ -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();
}
OpenPOWER on IntegriCloud