]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
runtime: don't stat a NULL filename
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 28 Jun 2018 20:54:04 +0000 (20:54 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 28 Jun 2018 20:54:04 +0000 (20:54 +0000)
    Noticed in https://gcc.gnu.org/PR86331.

    Reviewed-on: https://go-review.googlesource.com/121417

From-SVN: r262234

gcc/go/gofrontend/MERGE
libgo/runtime/go-caller.c

index 3d825803ae819b854c1c225c10f32eb236a0aa36..237c46d9a66fc5bcefac01c273367c430e259c86 100644 (file)
@@ -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.
index 6b26ddccbcf2e6bbe0942f1ce984d0302f2e72b7..7f36955c069bfdcf8ede20bd25e6b46614e5d007 100644 (file)
@@ -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);