aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2018-06-28 20:54:04 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-06-28 20:54:04 +0000
commit94e12bd4d9b7de6cc4a084c7b453a0e26210f56e (patch)
treeae65c319bfeb98b4332946ac7f27375be3ba4e03
parenteacb16dc798d06acfb9741a2496584ab0728257a (diff)
downloadgcc-94e12bd4d9b7de6cc4a084c7b453a0e26210f56e.zip
gcc-94e12bd4d9b7de6cc4a084c7b453a0e26210f56e.tar.gz
gcc-94e12bd4d9b7de6cc4a084c7b453a0e26210f56e.tar.bz2
runtime: don't stat a NULL filename
Noticed in https://gcc.gnu.org/PR86331. Reviewed-on: https://go-review.googlesource.com/121417 From-SVN: r262234
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--libgo/runtime/go-caller.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 3d82580..237c46d 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-baaaf1e0f1e9a54ea2dfe475154c85c83ec03740
+e1fcce0aec27b1f50ac0e736f39f4c806c2a5baa
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/libgo/runtime/go-caller.c b/libgo/runtime/go-caller.c
index 6b26ddc..7f36955 100644
--- a/libgo/runtime/go-caller.c
+++ b/libgo/runtime/go-caller.c
@@ -116,7 +116,7 @@ __go_get_backtrace_state ()
argv[0] (http://gcc.gnu.org/PR61895). It would be nice to
have a better check for whether this file is the real
executable. */
- if (stat (filename, &s) < 0 || s.st_size < 1024)
+ if (filename != NULL && (stat (filename, &s) < 0 || s.st_size < 1024))
filename = NULL;
back_state = backtrace_create_state (filename, 1, error_callback, NULL);