From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Preventing stack overflows with alloca. Date: 22 Jun 2004 00:01:33 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200406181113.UAA03743@etlken.m17n.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1087855322 21749 80.91.224.253 (21 Jun 2004 22:02:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 Jun 2004 22:02:02 +0000 (UTC) Cc: emacs-devel@gnu.org, handa@m17n.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Jun 22 00:01:55 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BcWrT-00054L-00 for ; Tue, 22 Jun 2004 00:01:55 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BcWrS-0000i1-00 for ; Tue, 22 Jun 2004 00:01:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BcWsh-0008Kf-9v for emacs-devel@quimby.gnus.org; Mon, 21 Jun 2004 18:03:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BcWsY-0008Ka-SB for emacs-devel@gnu.org; Mon, 21 Jun 2004 18:03:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BcWsX-0008K5-6G for emacs-devel@gnu.org; Mon, 21 Jun 2004 18:03:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BcWsX-0008K2-2M for emacs-devel@gnu.org; Mon, 21 Jun 2004 18:03:01 -0400 Original-Received: from [195.41.46.235] (helo=pfepa.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BcWqm-0002Uf-BY; Mon, 21 Jun 2004 18:01:12 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepa.post.tele.dk (Postfix) with SMTP id 2F6F947FE25; Tue, 22 Jun 2004 00:01:10 +0200 (CEST) Original-To: rms@gnu.org In-Reply-To: Original-Lines: 20 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25162 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25162 Richard Stallman writes: > Since old_value is not a lisp object here, > we would need to fix (hack) GC like this: > > for (bind = specpdl; bind != specpdl_ptr; bind++) > { > mark_object (bind->symbol); > if (bind->func != safe_alloca_unwind) > mark_object (bind->old_value); > } > > Or else use make_save_value to convert it to a clean Lisp object. > Then GC won't need changing. I installed the SAFE_ALLOCA macros, using the make_save_value approach. I also fixed the alloca uses that looked suspicious to me. -- Kim F. Storm http://www.cua.dk