# HG changeset patch # User Andreas Schwab # Date 1220819714 0 # Node ID 4ea0f5996bd5a8b4203e12568ab4f835aeffebea # Parent b72d358fea719f71e7398759bb3775db252fefaf (Fcall_process): Don't hold references to string data across garbage collection. Move initialisation of new_argv down to avoid compiler bug. diff -r b72d358fea71 -r 4ea0f5996bd5 src/ChangeLog --- a/src/ChangeLog Sun Sep 07 20:34:05 2008 +0000 +++ b/src/ChangeLog Sun Sep 07 20:35:14 2008 +0000 @@ -1,3 +1,9 @@ +2008-09-07 Andreas Schwab + + * callproc.c (Fcall_process): Don't hold references to string data + across garbage collection. Move initialisation of new_argv down + to avoid compiler bug. + 2008-09-07 Roland Winkler * process.c (Fsystem_process_attributes): Doc fix. diff -r b72d358fea71 -r 4ea0f5996bd5 src/callproc.c --- a/src/callproc.c Sun Sep 07 20:34:05 2008 +0000 +++ b/src/callproc.c Sun Sep 07 20:35:14 2008 +0000 @@ -226,8 +226,7 @@ int bufsize = CALLPROC_BUFFER_SIZE_MIN; int count = SPECPDL_INDEX (); - register const unsigned char **new_argv - = (const unsigned char **) alloca ((max (2, nargs - 2)) * sizeof (char *)); + register const unsigned char **new_argv; struct buffer *old = current_buffer; /* File to use for stderr in the child. t means use same as standard output. */ @@ -414,7 +413,8 @@ && SREF (path, 1) == ':') path = Fsubstring (path, make_number (2), Qnil); - new_argv[0] = SDATA (path); + new_argv = (const unsigned char **) + alloca (max (2, nargs - 2) * sizeof (char *)); if (nargs > 4) { register int i; @@ -428,13 +428,15 @@ if (CODING_REQUIRE_ENCODING (&argument_coding)) /* We must encode this argument. */ args[i] = encode_coding_string (&argument_coding, args[i], 1); - new_argv[i - 3] = SDATA (args[i]); } UNGCPRO; - new_argv[nargs - 3] = 0; + for (i = 4; i < nargs; i++) + new_argv[i - 3] = SDATA (args[i]); + new_argv[i - 3] = 0; } else new_argv[1] = 0; + new_argv[0] = SDATA (path); #ifdef MSDOS /* MW, July 1993 */ if ((outf = egetenv ("TMPDIR")))