diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-11-14 22:31:29 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-11-14 22:31:29 +0000 |
commit | 37512c0399662de47eef61e054672968ac07845e (patch) | |
tree | f074ab46da67db1ab0e5efd70cec935d3bad85b8 /libgo/runtime/go-caller.c | |
parent | 58c55a329a8fff3e4e206b1b944572795821b518 (diff) | |
download | gcc-37512c0399662de47eef61e054672968ac07845e.zip gcc-37512c0399662de47eef61e054672968ac07845e.tar.gz gcc-37512c0399662de47eef61e054672968ac07845e.tar.bz2 |
runtime: Don't use filename without '/' for backtrace library.
Fixes http://golang.org/issue/6715.
From-SVN: r204828
Diffstat (limited to 'libgo/runtime/go-caller.c')
-rw-r--r-- | libgo/runtime/go-caller.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libgo/runtime/go-caller.c b/libgo/runtime/go-caller.c index 8ca3c7e..c49704d 100644 --- a/libgo/runtime/go-caller.c +++ b/libgo/runtime/go-caller.c @@ -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); |