From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.devel Subject: Re: Implementing R6RS `transcoded-port' Date: Mon, 26 Jul 2010 10:21:14 +0200 Message-ID: <878w4yu005.fsf@ambire.localdomain> References: <87eiere5pl.fsf@delenn.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1280132673 488 80.91.229.12 (26 Jul 2010 08:24:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 26 Jul 2010 08:24:33 +0000 (UTC) Cc: Guile Development To: Andreas Rottmann Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jul 26 10:24:32 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OdIzA-0003Tc-6L for guile-devel@m.gmane.org; Mon, 26 Jul 2010 10:24:32 +0200 Original-Received: from localhost ([127.0.0.1]:58362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OdIz7-0005Qg-EP for guile-devel@m.gmane.org; Mon, 26 Jul 2010 04:24:29 -0400 Original-Received: from [140.186.70.92] (port=39098 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OdIyy-0005Q6-Hd for guile-devel@gnu.org; Mon, 26 Jul 2010 04:24:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OdIyt-00025L-Cq for guile-devel@gnu.org; Mon, 26 Jul 2010 04:24:20 -0400 Original-Received: from smtp205.alice.it ([82.57.200.101]:60901) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdIyt-000252-44 for guile-devel@gnu.org; Mon, 26 Jul 2010 04:24:15 -0400 Original-Received: from ambire.localdomain (95.244.64.81) by smtp205.alice.it (8.5.124.08) id 4C1A264502730FB0; Mon, 26 Jul 2010 10:24:10 +0200 Original-Received: from ttn by ambire.localdomain with local (Exim 4.69) (envelope-from ) id 1OdIvy-0001Uf-Pt; Mon, 26 Jul 2010 10:21:14 +0200 In-Reply-To: <87eiere5pl.fsf@delenn.lan> (Andreas Rottmann's message of "Sun, 25 Jul 2010 21:12:22 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Windows 98 (1) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10733 Archived-At: () Andreas Rottmann () Sun, 25 Jul 2010 21:12:22 +0200 result_pt->file_name =3D pt->file_name; result_pt->line_number =3D pt->line_number; result_pt->column_number =3D pt->column_number; result_pt->read_buf =3D pt->read_buf; result_pt->read_pos =3D pt->read_pos; result_pt->read_end =3D pt->read_end; result_pt->read_buf_size =3D pt->read_buf_size; result_pt->saved_read_buf =3D pt->saved_read_buf; result_pt->saved_read_pos =3D pt->saved_read_pos; result_pt->saved_read_end =3D pt->saved_read_end; result_pt->saved_read_buf_size =3D pt->saved_read_buf_size; result_pt->write_buf =3D pt->write_buf; result_pt->write_pos =3D pt->write_pos; result_pt->write_end =3D pt->write_end; result_pt->write_buf_size =3D pt->write_buf_size; result_pt->shortbuf =3D pt->shortbuf; result_pt->rw_random =3D pt->rw_random; result_pt->rw_active =3D pt->rw_active; result_pt->putback_buf =3D pt->putback_buf; result_pt->putback_buf_size =3D pt->putback_buf_size;=20 scm_i_remove_port (port); SCM_CLR_PORT_OPEN_FLAG (port); Most likely =E2=80=98scm_i_remove_port=E2=80=99 arranges to clean up pt->FO= O, so =E2=80=98gc=E2=80=99 ends up leaving some these assigned members (result_pt->FOO) pointing to "valid" memory with invalid contents. For those, a pointer copy is insufficient; you need to copy their contents to newly allocated memory.