summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/runtime/libprofile/GCDAProfiling.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/runtime/libprofile/GCDAProfiling.c b/llvm/runtime/libprofile/GCDAProfiling.c
index 712dba08be4..233a2f390f4 100644
--- a/llvm/runtime/libprofile/GCDAProfiling.c
+++ b/llvm/runtime/libprofile/GCDAProfiling.c
@@ -114,8 +114,9 @@ void llvm_gcda_start_file(const char *orig_filename) {
output_file = fopen(filename, "wb");
if (!output_file) {
+ const char *cptr = 0;
filename[0] = '\0'; /* The size of filename should be big enough. */
- char *cptr = strrchr(orig_filename, '/');
+ cptr = strrchr(orig_filename, '/');
strcat(filename, cptr ? cptr + 1 : orig_filename);
output_file = fopen(filename, "wb");
OpenPOWER on IntegriCloud