]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
runtime: Don't use filename without '/' for backtrace library.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 14 Nov 2013 22:31:29 +0000 (22:31 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 14 Nov 2013 22:31:29 +0000 (22:31 +0000)
Fixes http://golang.org/issue/6715.

From-SVN: r204828

libgo/runtime/go-caller.c

index 8ca3c7efcd7a170247a69c94cc8f6f4271eba05c..c49704df4163331bb419efeef1aba591817882aa 100644 (file)
@@ -101,6 +101,13 @@ __go_get_backtrace_state ()
       const char *filename;
 
       filename = (const char *) runtime_progname ();
+
+      /* If there is no '/' in FILENAME, it was found on PATH, and
+        might not be the same as the file with the same name in the
+        current directory.  */
+      if (__builtin_strchr (filename, '/') == NULL)
+       filename = NULL;
+
       back_state = backtrace_create_state (filename, 1, error_callback, NULL);
     }
   runtime_unlock (&back_state_lock);