Move the zeroing back before the dladdr() call.
authorJarkko Hietaniemi <jhi@iki.fi>
Sun, 27 Mar 2016 15:11:18 +0000 (11:11 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 27 Mar 2016 15:40:28 +0000 (11:40 -0400)
util.c

diff --git a/util.c b/util.c
index 9722071..9ad40c1 100644 (file)
--- a/util.c
+++ b/util.c
@@ -6384,15 +6384,15 @@ Perl_get_c_backtrace(pTHX_ int depth, int skip)
         for (i = skip; i < try_depth; i++) {
             Dl_info* dl_info = &dl_infos[i];
 
+            object_name_sizes[i] = 0;
+            source_names[i] = NULL;
+            source_name_sizes[i] = 0;
+            source_lines[i] = 0;
+
             /* Yes, zero from dladdr() is failure. */
             if (dladdr(raw_frames[i], dl_info)) {
                 total_bytes += sizeof(Perl_c_backtrace_frame);
 
-                object_name_sizes[i] = 0;
-                source_names[i] = NULL;
-                source_name_sizes[i] = 0;
-                source_lines[i] = 0;
-
                 object_name_sizes[i] =
                     dl_info->dli_fname ? strlen(dl_info->dli_fname) : 0;
                 symbol_name_sizes[i] =