Commit 37512c03 by Ian Lance Taylor

runtime: Don't use filename without '/' for backtrace library.

Fixes http://golang.org/issue/6715.

From-SVN: r204828
parent 58c55a32
...@@ -101,6 +101,13 @@ __go_get_backtrace_state () ...@@ -101,6 +101,13 @@ __go_get_backtrace_state ()
const char *filename; const char *filename;
filename = (const char *) runtime_progname (); 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); back_state = backtrace_create_state (filename, 1, error_callback, NULL);
} }
runtime_unlock (&back_state_lock); runtime_unlock (&back_state_lock);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment