From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: /srv/bzr/emacs/trunk r103781: * src/bytecode.c (Fbyte_code): CAR and CDR can GC. Date: Wed, 30 Mar 2011 12:41:56 -0700 Message-ID: <4D938784.2000701@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1301514136 26103 80.91.229.12 (30 Mar 2011 19:42:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 Mar 2011 19:42:16 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 30 21:42:10 2011 Return-path: Envelope-to: ged-emacs-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 1Q51HN-0002xl-AL for ged-emacs-devel@m.gmane.org; Wed, 30 Mar 2011 21:42:09 +0200 Original-Received: from localhost ([127.0.0.1]:41744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q51HM-0004LL-RH for ged-emacs-devel@m.gmane.org; Wed, 30 Mar 2011 15:42:08 -0400 Original-Received: from [140.186.70.92] (port=34176 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q51HF-0004Jl-R1 for emacs-devel@gnu.org; Wed, 30 Mar 2011 15:42:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q51HE-0005ZB-DK for emacs-devel@gnu.org; Wed, 30 Mar 2011 15:42:01 -0400 Original-Received: from mail-px0-f179.google.com ([209.85.212.179]:63114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q51HE-0005Yx-8n for emacs-devel@gnu.org; Wed, 30 Mar 2011 15:42:00 -0400 Original-Received: by pxi2 with SMTP id 2so389263pxi.38 for ; Wed, 30 Mar 2011 12:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=BjgDiE9rB2Sa7gG42a6dOHqBAPIpF5uZvgEsANREAfU=; b=FWOlc7rSUgEayFsYwFOWm9NqgBph4qZnJJ+YF59ciTxVjiPSZa/D03oUqYEJKhLYqK I73HDG92STGb45Dx7GByMrslv8fAkAmN/lIeQRPL0hs8gJ33z+GczT3GwS6t9lNr40D/ bHRxSyw3x2wPIeAz7w9u4OvltXtNfOfb8A13A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=hMY06jLh9boVvu2tyeRZhvvlGgHqCacotrl/vIEwwul93KH8A67JPvDs33y/DyTBfr x1JLAwHHcreMqmCDW/pkc2N7Bj9jqvdnGSECttFjWCjhnN2tv5E0gBwbHhWiroyDk+p6 jNVvCFJYMobqHCISjLXViMJ6NF2/oLqoG4y8E= Original-Received: by 10.142.61.18 with SMTP id j18mr1269864wfa.75.1301514118668; Wed, 30 Mar 2011 12:41:58 -0700 (PDT) Original-Received: from [0.0.0.0] (c-67-183-23-114.hsd1.wa.comcast.net [67.183.23.114]) by mx.google.com with ESMTPS id s41sm470573wfc.3.2011.03.30.12.41.57 (version=SSLv3 cipher=OTHER); Wed, 30 Mar 2011 12:41:57 -0700 (PDT) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.212.179 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:137928 Archived-At: On 3/30/2011 11:04 AM, Stefan Monnier wrote: > ------------------------------------------------------------ > revno: 103781 > committer: Stefan Monnier > branch nick: trunk > timestamp: Wed 2011-03-30 14:04:11 -0400 > message: > * src/bytecode.c (Fbyte_code): CAR and CDR can GC. Wait, what? How? wrong_type_argument never returns. If we run into a problem, we'll throw up to some higher context and never hit the AFTER_POTENTIAL_GC case. BEFORE_POTENTIAL_GC (if it's not a noop) sets the stack top field to point to the top of the stack, but because we never return from wrong_type_argument, we don't care whether the stack is lost. v1 might be on the stack, so the only thing keeping it alive might be stack.top. Now, Fsignal *does* run signal-hook-function, which of course might GC. But that's done using call2, which will keep error_symbol and data alive even if we do GC, so a GC in this case shouldn't actually cause any problems. Likewise for the debugging hooks. So GC shouldn't actually cause a problem, IIUC. What am I missing? === modified file 'src/ChangeLog' --- a/src/ChangeLog 2011-03-30 13:35:37 +0000 +++ b/src/ChangeLog 2011-03-30 18:04:11 +0000 @@ -1,3 +1,7 @@ +2011-03-30 Stefan Monnier + + * bytecode.c (Fbyte_code): CAR and CDR can GC. + 2011-03-30 Zachary Kanfer (tiny change) * keyboard.c (Fexecute_extended_command): Do log the "suggest key === modified file 'src/bytecode.c' --- a/src/bytecode.c 2011-03-17 02:18:00 +0000 +++ b/src/bytecode.c 2011-03-30 18:04:11 +0000 @@ -554,7 +554,16 @@ { Lisp_Object v1; v1 = TOP; - TOP = CAR (v1); + if (CONSP (v1)) + TOP = XCAR (v1); + else if (NILP (v1)) + TOP = Qnil; + else + { + BEFORE_POTENTIAL_GC (); + wrong_type_argument (Qlistp, v1); + AFTER_POTENTIAL_GC (); + } break; } @@ -580,7 +589,17 @@ { Lisp_Object v1; v1 = TOP; - TOP = CDR (v1); + if (CONSP (v1)) + TOP = XCDR (v1); + else if (NILP (v1)) + TOP = Qnil; + else + { + BEFORE_POTENTIAL_GC (); + wrong_type_argument (Qlistp, v1); + AFTER_POTENTIAL_GC (); + } + break; break; } @@ -911,13 +930,13 @@ v1 = POP; v2 = TOP; CHECK_NUMBER (v2); - AFTER_POTENTIAL_GC (); op = XINT (v2); immediate_quit = 1; while (--op >= 0 && CONSP (v1)) v1 = XCDR (v1); immediate_quit = 0; TOP = CAR (v1); + AFTER_POTENTIAL_GC (); break; }