From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: wrong GCPRO in openp () Date: Mon, 06 Feb 2006 21:43:04 +0900 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1139237131 17871 80.91.229.2 (6 Feb 2006 14:45:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 6 Feb 2006 14:45:31 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 06 15:45:29 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F67bO-0005F9-ME for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2006 15:44:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F67dj-0001vB-LH for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2006 09:46:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F65r6-0008Ct-O5 for emacs-devel@gnu.org; Mon, 06 Feb 2006 07:52:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F65n6-0007SS-Vc for emacs-devel@gnu.org; Mon, 06 Feb 2006 07:48:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F65lK-0006ir-Sy for emacs-devel@gnu.org; Mon, 06 Feb 2006 07:46:34 -0500 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1F65ks-0006Y3-MS for emacs-devel@gnu.org; Mon, 06 Feb 2006 07:46:07 -0500 Original-Received: from nfs.m17n.org (nfs.m17n.org [192.47.44.7]) by tsukuba.m17n.org (8.13.4/8.13.4/Debian-3) with ESMTP id k16Ch5tx004877 for ; Mon, 6 Feb 2006 21:43:05 +0900 Original-Received: from etlken (etlken.m17n.org [192.47.44.125]) by nfs.m17n.org (8.13.4/8.13.4/Debian-3) with ESMTP id k16Ch5iL029763 for ; Mon, 6 Feb 2006 21:43:05 +0900 Original-Received: from handa by etlken with local (Exim 3.36 #1 (Debian)) id 1F65hw-0005H9-00 for ; Mon, 06 Feb 2006 21:43:04 +0900 Original-To: emacs-devel@gnu.org User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) 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:50103 Archived-At: I've just got a bug report about wrong GCPRO in openp (). The relevant code is this: openp (path, str, suffixes, storeptr, predicate) [...] { [...] string = filename = Qnil; GCPRO6 (str, string, filename, path, suffixes, encoded_fn); As encoded_fn is not yet initialized here, there's a possibility that it leads to crash in mark_object. As a simple fix is to initialized it to Qnil, I've just installed such a change. But, the variable encoded_fn is used as this: [...] else { const char *pfn; encoded_fn = ENCODE_FILE (string); pfn = SDATA (encoded_fn); exists = (stat (pfn, &st) >= 0 && (st.st_mode & S_IFMT) != S_IFDIR); if (exists) { /* Check that we can access or open it. */ if (NATNUMP (predicate)) fd = (access (pfn, XFASTINT (predicate)) == 0) ? 1 : -1; else fd = emacs_open (pfn, O_RDONLY, 0); [...] So, I think there's no need of GCPRO for encoded_fn. Eli, it seems that you are the last one who changed the code around here. 2002-03-29 Eli Zaretskii [...] * lread.c (openp, Fload): Encode the file name before passing it to `stat', `access', and `emacs_open'. (openp): GCPRO the encoded file name. Don't recompute Lisp strings unnecessarily. Do you remember why you did this change? --- Kenichi Handa handa@m17n.org