about summary refs log tree commit diff
path: root/instrumentation/afl-gcc-pass.so.cc
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-04-25 10:14:19 +0200
committerGitHub <noreply@github.com>2022-04-25 10:14:19 +0200
commitc7bb0a9638a8929a5b664f16032c23a55a84be70 (patch)
tree2fb8cee9897c46a53e756e898de732c63f2a8842 /instrumentation/afl-gcc-pass.so.cc
parentac80678592ea4a790ab2eedccfec4e3bc9f96447 (diff)
parentee409d18a6678c3f5948f51db8964148cae021dc (diff)
downloadafl++-c7bb0a9638a8929a5b664f16032c23a55a84be70.tar.gz
Merge pull request #1392 from AFLplusplus/dev
push to stable
Diffstat (limited to 'instrumentation/afl-gcc-pass.so.cc')
-rw-r--r--instrumentation/afl-gcc-pass.so.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/instrumentation/afl-gcc-pass.so.cc b/instrumentation/afl-gcc-pass.so.cc
index 734fa170..bb5483fc 100644
--- a/instrumentation/afl-gcc-pass.so.cc
+++ b/instrumentation/afl-gcc-pass.so.cc
@@ -714,9 +714,11 @@ struct afl_pass : gimple_opt_pass {
 
   }
 
+  /* Returns the source file name attached to the function declaration F. If
+     there is no source location information, returns an empty string.  */
   std::string getSourceName(function *F) {
 
-    return DECL_SOURCE_FILE(F->decl);
+    return DECL_SOURCE_FILE(F->decl) ? DECL_SOURCE_FILE(F->decl) : "";
 
   }