From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Naoya Yamashita Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP Date: Tue, 02 Mar 2021 16:14:18 +0900 (JST) Message-ID: <20210302.161418.2185996023660309707.conao3@gmail.com> References: <20210302.111043.609653289571449353.conao3@gmail.com> <83ft1e6rjb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16146"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pipcet@gmail.com, emacs-devel@gnu.org To: eliz@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 02 08:17:37 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lGzHk-00045E-RP for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Mar 2021 08:17:36 +0100 Original-Received: from localhost ([::1]:53840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGzHj-0004ys-U1 for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Mar 2021 02:17:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGzFk-00043B-H7 for emacs-devel@gnu.org; Tue, 02 Mar 2021 02:15:34 -0500 Original-Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:33473) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lGzFS-0007zP-Nx; Tue, 02 Mar 2021 02:15:29 -0500 Original-Received: by mail-pj1-x102c.google.com with SMTP id i4-20020a17090a7184b02900bfb60fbc6bso817111pjk.0; Mon, 01 Mar 2021 23:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:cc:subject:from:in-reply-to:references :mime-version:content-transfer-encoding; bh=5lNCZVonTrh/DGBax6Sb8x791UHzdN2Rjsab/y74kHA=; b=E4E1iZ2VBZV+wJP66xO+ym/CHLfDlruUn6ZVgbzWiLy8lZ5a5Zc0AcaMmgIvEOlVr5 AaGkHFpt6Tot3A0JLU24a5gNSlqa/9oJFQYAVeHYdhDmXrVJbq6TGxMPDTMbSrUY5nDs qIqbxe+Q7dJFmZWDUOFKIF0n9vhFz+pT3cV+Ais8ULnTOBI16R8oPlwmhcDMnAvMHXFs 6bSYBjSuidCGYFfThJRmp9UqUTgzUt6TKqYzcq3QhAeG/RqDlLdU4e37fbErH8sHiP3V 9287YG8Fot4Gc8/nGcemSl79yYafIUKJq6yuiXoEbzvRRqK0ys3nCuXL9qkSrmdVeOrB gDEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:mime-version:content-transfer-encoding; bh=5lNCZVonTrh/DGBax6Sb8x791UHzdN2Rjsab/y74kHA=; b=Z/mskghV7E0U37rg4rT7zQsYCJdopg4LbB+TOmaKZyC78BZBBQ6INvUG9+s/DiG3bS g+cP9vF1iCN9e2Kct3BOLEoasOLnzyhorZYCR5O01PSU5T7rRiqdNXJ0NYrc9pRhm1FH j7gTVnPx2S+RIwwkI2KAHyEzlMsL84MdkTTXtdVRhgdCYeJDbKzSxVGr8uIrTEkWQ7QY iaRAokTaQWNv7CSZbN819BCtYkXvfKgWPNcraoeCl9+zUQROJ1wtPhvP9K0G6fjzPu86 CV4iMwkY6QFl9WelnHKQm1f0hO31pi+8xiKmorKfdH6fR8WpT76fzeyTO5SXqBhui3K9 AxQQ== X-Gm-Message-State: AOAM5302p8Fze1i+OsXif4tRj0HzBIbxEaZHV6IbCeFqB1Xif6rVCn/b lcDdPaLaqdPhXpRc7InAwNyt0vSyZ3G0eg== X-Google-Smtp-Source: ABdhPJygpKcP4SD7MC2XvsLwKdGU29aJ+JdrdRKlUscOmlEzH6pTDpDil7UufxjFMGu0PLPkAD32nQ== X-Received: by 2002:a17:90b:4a44:: with SMTP id lb4mr2998643pjb.92.1614669310359; Mon, 01 Mar 2021 23:15:10 -0800 (PST) Original-Received: from localhost (p210141-ipngn200407niho.hiroshima.ocn.ne.jp. [118.4.79.141]) by smtp.gmail.com with ESMTPSA id c24sm20421582pfd.11.2021.03.01.23.15.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Mar 2021 23:15:10 -0800 (PST) In-Reply-To: <83ft1e6rjb.fsf@gnu.org> X-Mailer: Mew version 6.8 on Emacs 27.1 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=conao3@gmail.com; helo=mail-pj1-x102c.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:265811 Archived-At: Thanks, eli. > They aren't redundant, they were added to avoid crashes in certain > rare use cases. See commit 93511e9 and the emacs-devel discussion > which the log message refers to. If the problems described there are > no longer pertinent, can you explain why? TIA. Thanks for mentioning 93511e9. I compared the two and found that the problem of crashing on (if . "abc") crash problem was fixed in the former. However (let ((vars (list 'v)))) (setcdr vars vars) (eval (list let vars)))) and (let ((clauses (list '((progn (setcdr clauses "ouch")) nil))))) (eval (cons 'cond clauses)))) did not crash. The circular list example became an infinite loop in an older version of b3a3ed5 (even older changes to eval.c). My change removed the list length checker, which is vulnerable to list changes. Furthermore, Emacs with my patch passes these test cases. My patched Emacs does not segfault the Pip example either. (let ((cons-cell '((a 2) (b 3)))) (eval `(let ((x (setcdr ',cons-cell nil)) . ,cons-cell) (message "foo")))) ;;=> foo Please let me know if there are any test cases I'm missing. > P.S. When I see code in Emacs that looks wrong/redundant/unclear, I > find it useful to look at the VC history of that code. This is how I > discovered where this particular "redundancy" came from, just 3.5 > years ago. Thanks, I find `M-x vc-history-region` and this is very useful! I should use before write a patch.