From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66912: With `require', the byte compiler reports the wrong file for errors. Date: Sun, 03 Nov 2024 21:46:42 -0500 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18239"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 66912@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 04 03:47:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t7n7e-0004bz-8O for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Nov 2024 03:47:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7n7S-00052R-Ly; Sun, 03 Nov 2024 21:47:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7n7P-0004rx-CK for bug-gnu-emacs@gnu.org; Sun, 03 Nov 2024 21:47:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7n7P-0000dZ-3y for bug-gnu-emacs@gnu.org; Sun, 03 Nov 2024 21:47:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=N+zJLICGYaIPA3xIkYR3GCMx7MEQ0OfrzT2emmrGYPA=; b=EAvZnRDsGH5OWiDPW4pcdELUKE0eQR6dNA+CzLiarMmZl3VfXFbEnHFNmXK0pf/qLH6nzuQwnHlDs6DotR55uPdDLji5o++k/bqJlKk+pUc2f0k8ysQQ3FDyPG6O4E1DBmyBxgMEBzOarYrINve0Timn+pL08mkQzXlj8+CVSCge36VRlrrBZBorj1fNylAMUhatEg6xEshONM0VEUd2kLGDv2UEfyb0/hR7y9TlE5bANvPJGWbL3B99LOcW0hQifQkxXJTOwKUP6xzrEHJTVME/jZT4HkGq6H4TN+P1bkEK7NAn+ZZuJR88SKo3ciFweuKfqza49C29NqUyL6mMkg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t7n7O-0007uJ-CK for bug-gnu-emacs@gnu.org; Sun, 03 Nov 2024 21:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Nov 2024 02:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66912 X-GNU-PR-Package: emacs Original-Received: via spool by 66912-submit@debbugs.gnu.org id=B66912.173068841330386 (code B ref 66912); Mon, 04 Nov 2024 02:47:02 +0000 Original-Received: (at 66912) by debbugs.gnu.org; 4 Nov 2024 02:46:53 +0000 Original-Received: from localhost ([127.0.0.1]:36631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7n7F-0007u2-6B for submit@debbugs.gnu.org; Sun, 03 Nov 2024 21:46:53 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:20758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7n7C-0007tu-ON for 66912@debbugs.gnu.org; Sun, 03 Nov 2024 21:46:52 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0E1261000C3; Sun, 3 Nov 2024 21:46:44 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1730688403; bh=iAjVAwampBRv3kXPrCGVov6pVGLJ6uZmTV/mkU91VX0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=PYywALgQKAmMtpuOGLpvu7aTPtO8vUBO43pcIhDul/Fm5wYBvW48MHi/xlLtAZAL1 9mtugGNmgCohw04G73J6pCo9gA7i84UqkM8bNGBhU5rnDbf1CUGPoj99kB5gH3EVdv dDqUrWFc9RcEbvNFWUU1D1oxtF8f8rDCAhW05nHD6ze/claYMNFN9hK64/SGfKeern FOf5lp9/1htQmJ23pNY5uT4LEE3NNko3Lgn2twxuiKIjKnCfG6qddMPJaVFQ517Ify 3L0DdFJmEMgJJyz1S7q34d1L9J4NrtT/hMG6J8Mn9Sw9IjDpHBU0isUrfTPYYrjpS6 gjTHvaPkbGWFg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 355EC100042; Sun, 3 Nov 2024 21:46:43 -0500 (EST) Original-Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0D50F12038B; Sun, 3 Nov 2024 21:46:43 -0500 (EST) In-Reply-To: (Alan Mackenzie's message of "Sun, 3 Nov 2024 22:34:58 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294832 Archived-At: Hi Alan, I couldn't properly review your code because I had trouble understanding it. So instead, it's mostly questions. > +static Lisp_Object > +internal_cc_hb (enum handlertype handlertype, > + Lisp_Object (*bfun) (void), Lisp_Object handlers, > + Lisp_Object (*hfun) (Lisp_Object)) > +{ > + struct handler *c = push_handler (handlers, handlertype); > + > + if (handlertype == HANDLER_BIND) > + { > + c->val = Qnil; > + c->bin_handler = hfun; > + c->bytecode_dest = 0; > + } > + if (sys_setjmp (c->jmp)) > + { > + Lisp_Object val = handlerlist->val; > + clobbered_eassert (handlerlist == c); > + handlerlist = handlerlist->next; > + return hfun (val); > + } > + else > + { > + Lisp_Object val = bfun (); > + eassert (handlerlist == c); > + handlerlist = c->next; > + return val; > + } > +} I don't understand the above code: `handler-bind` is not supposed to call setjmp/longjmp: when the handler of a `handler-bind` gets called, the stack is not unwound. So what is the `sys_setjmp` for when `handlertype == HANDLER_BIND`? > @@ -1900,9 +2066,12 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool continuable) > max_ensure_room (20); > push_handler (make_fixnum (skip + h->bytecode_dest), > SKIP_CONDITIONS); > - call1 (h->val, error); > - unbind_to (count, Qnil); > - pop_handler (); > + if (NILP (h->val)) > + (h->bin_handler) (error); [ We don't need parens around `h->bin_handler`. ] > + else > + call1 (h->val, error); > + unbind_to (count, Qnil); /* Removes SKIP_CONDITIONS handler. */ > + pop_handler (); /* Discards HANDLER_BIND handler. */ These comments don't match my understanding of the code: IIRC the `pop_handler` pops the `SKIP_CONDITIONS` handler. Also there's no reason to presume the HANDLER_BIND handler is at the top, so if we wanted to remove it, we'd have to work harder. > +/* Handle errors signalled by the above function. */ > +static Lisp_Object > +rel_error_handler (Lisp_Object err) > +{ > + if (!NILP (Vdebug_on_error)) > + { > + call_debugger (err); > + Fthrow (Qtop_level, Qt); > + } > + else > + return err; > +} I don't understand that. AFAICT, this is the only HANDLER_BIND handler you install from C code, right? So this is the thing that motivates all the changes like `internal_cc_hb`, etc... so clearly it must do something worthwhile, but I don't see what it is. How is this related to `Fprefix_load_file_names`? Stefan