aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorEdwin Török <edwintorok@gmail.com>2009-12-10 10:01:47 +0000
committerEdwin Török <edwintorok@gmail.com>2009-12-10 10:01:47 +0000
commit6d9ba4b1d7364823556c97a78142ecd28048e3a3 (patch)
tree96347feb03aecc5e31331772255b7f75d417081b /lib/ExecutionEngine
parenta4ea68be726443c35446332dbdeff00f42f7e48b (diff)
downloadexternal_llvm-6d9ba4b1d7364823556c97a78142ecd28048e3a3.zip
external_llvm-6d9ba4b1d7364823556c97a78142ecd28048e3a3.tar.gz
external_llvm-6d9ba4b1d7364823556c97a78142ecd28048e3a3.tar.bz2
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
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp b/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp
index 076e5a0..52a8f71 100644
--- a/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp
+++ b/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();
}