about summary refs log tree commit diff
path: root/instrumentation/afl-gcc-pass.so.cc
diff options
context:
space:
mode:
authorlazymio <mio@lazym.io>2022-04-24 20:13:40 +0200
committerlazymio <mio@lazym.io>2022-04-24 20:13:40 +0200
commitee50f41d29ea67282e7bd2a2fc495c6e09922916 (patch)
tree346a5bd5066ee472cb329fe628eda0f53d83b20e /instrumentation/afl-gcc-pass.so.cc
parentaeeca164b5a01eebc9c7cb386155375980e1fdc2 (diff)
parentb2c96f66eef42a58d2b62f98a5cec6f5f483dbde (diff)
downloadafl++-ee50f41d29ea67282e7bd2a2fc495c6e09922916.tar.gz
Merge origin/dev
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) : "";
 
   }