[PATCH, Fortran] Fix execution tests on simulator

Tobias Burnus burnus@net-b.de
Sat Dec 6 19:18:00 GMT 2008


Adam Nemet wrote:
> I failed to copy the Fortran list for this (rather trivial) patch.
>
>   http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00100.html
>   
The patch is OK.

Tobias

	* runtime/main.c (store_exe_path): Don't crash if argv0 is NULL.

Index: main.c
===================================================================
--- main.c	(revision 142342)
+++ main.c	(working copy)
@@ -111,7 +111,8 @@ store_exe_path (const char * argv0)
 
   char buf[PATH_MAX], *cwd, *path;
 
-  if (argv0[0] == '/')
+  /* On the simulator argv is not set.  */
+  if (argv0 == NULL || argv0[0] == '/')
     {
       exe_path = argv0;
       please_free_exe_path_when_done = 0;




More information about the Fortran mailing list