From: Ian Lance Taylor Date: Thu, 14 Nov 2013 22:31:29 +0000 (+0000) Subject: runtime: Don't use filename without '/' for backtrace library. X-Git-Tag: releases/gcc-4.9.0~2776 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=37512c0399662de47eef61e054672968ac07845e;p=thirdparty%2Fgcc.git runtime: Don't use filename without '/' for backtrace library. Fixes http://golang.org/issue/6715. From-SVN: r204828 --- diff --git a/libgo/runtime/go-caller.c b/libgo/runtime/go-caller.c index 8ca3c7efcd7a..c49704df4163 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);