# HG changeset patch # User Andreas Schwab # Date 1246219940 0 # Node ID 70e98b9afe062291ab05400785ce36c02a5199c9 # Parent f9fb01c671836bb2e79597ab55e4feb008794a6d (send_process): Keep decoded string in a local variable and protect it from GC. (Bug#3521) diff -r f9fb01c67183 -r 70e98b9afe06 src/ChangeLog --- a/src/ChangeLog Sun Jun 28 20:01:28 2009 +0000 +++ b/src/ChangeLog Sun Jun 28 20:12:20 2009 +0000 @@ -1,3 +1,8 @@ +2009-06-28 Andreas Schwab + + * process.c (send_process): Keep decoded string in a local + variable and protect it from GC. (Bug#3521) + 2009-06-28 Eli Zaretskii * term.c (create_tty_output) [MSDOS]: #ifdef away. diff -r f9fb01c67183 -r 70e98b9afe06 src/process.c --- a/src/process.c Sun Jun 28 20:01:28 2009 +0000 +++ b/src/process.c Sun Jun 28 20:12:20 2009 +0000 @@ -5550,10 +5550,11 @@ struct Lisp_Process *p = XPROCESS (proc); int rv; struct coding_system *coding; - struct gcpro gcpro1; + struct gcpro gcpro1, gcpro2; SIGTYPE (*volatile old_sigpipe) (); - - GCPRO1 (object); + Lisp_Object dst_object = Qnil; + + GCPRO2 (object, dst_object); if (p->raw_status_new) update_status (p); @@ -5632,7 +5633,8 @@ } len = coding->produced; - buf = SDATA (coding->dst_object); + dst_object = coding->dst_object; + buf = SDATA (dst_object); } if (pty_max_bytes == 0) @@ -5764,7 +5766,7 @@ /* Running filters might relocate buffers or strings. Arrange to relocate BUF. */ if (CODING_REQUIRE_ENCODING (coding)) - offset = buf - SDATA (coding->dst_object); + offset = buf - SDATA (dst_object); else if (BUFFERP (object)) offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf); else if (STRINGP (object)) @@ -5777,7 +5779,7 @@ #endif if (CODING_REQUIRE_ENCODING (coding)) - buf = offset + SDATA (coding->dst_object); + buf = offset + SDATA (dst_object); else if (BUFFERP (object)) buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset); else if (STRINGP (object))