From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#21899: let/ec continuations not distinct under compiler Date: Fri, 24 Jun 2016 19:13:01 +0200 Message-ID: <87r3bmcxya.fsf@pobox.com> References: <20151113075736.GJ13455@fysh.org> <87ziqaczyx.fsf@pobox.com> <87vb0ycz39.fsf@pobox.com> <20160624170038.GG1170@fysh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1466788473 6156 80.91.229.3 (24 Jun 2016 17:14:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jun 2016 17:14:33 +0000 (UTC) Cc: 21899-done@debbugs.gnu.org To: Zefram Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Jun 24 19:14:23 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bGUgM-0004ni-8I for guile-bugs@m.gmane.org; Fri, 24 Jun 2016 19:14:18 +0200 Original-Received: from localhost ([::1]:45095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGUgL-0001Wm-Hp for guile-bugs@m.gmane.org; Fri, 24 Jun 2016 13:14:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGUgC-0001Uw-4h for bug-guile@gnu.org; Fri, 24 Jun 2016 13:14:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGUg7-0002wx-1z for bug-guile@gnu.org; Fri, 24 Jun 2016 13:14:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGUg6-0002ws-TR for bug-guile@gnu.org; Fri, 24 Jun 2016 13:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bGUg6-0001yT-QR for bug-guile@gnu.org; Fri, 24 Jun 2016 13:14:02 -0400 Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Fri, 24 Jun 2016 17:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 21899 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Mail-Followup-To: 21899@debbugs.gnu.org, wingo@pobox.com, zefram@fysh.org Original-Received: via spool by 21899-done@debbugs.gnu.org id=D21899.14667883937500 (code D ref 21899); Fri, 24 Jun 2016 17:14:02 +0000 Original-Received: (at 21899-done) by debbugs.gnu.org; 24 Jun 2016 17:13:13 +0000 Original-Received: from localhost ([127.0.0.1]:54589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGUfI-0001wu-Nm for submit@debbugs.gnu.org; Fri, 24 Jun 2016 13:13:12 -0400 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:60575 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGUfG-0001wl-6O for 21899-done@debbugs.gnu.org; Fri, 24 Jun 2016 13:13:10 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id CCF6B1FD93; Fri, 24 Jun 2016 13:13:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=J2Fi4oHbmFtENSfEGmlDiqZX/zQ=; b=rBaVJV P4KLQPK0F6uGUReTSFuMWLAb9RkzPBHb7+a3vtdx97yRQDtPpg5xR2U4GRv2mOpq GDESmgVDD7dk6iq8SM0h33kCZF8N1qlq/TGLwmJ+rlmDtPN7P8n9fFvq5YaHV+ri b7JrKVdlTWIJXLNI6+RQNtLtXenA0andQK48Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=KFjPLrgKo5X6X55jzfPgURRAiAo9eNrh 9qMphUHb4m2gAhwhd9EDvcvIsLqkzM8LvaAaiaGq3Lxzx8WcclDppuTzNgxkeuMG H66JVvmNzaZgGET4iq9wBHou5q9GZqWNwox1uULzuiMHe0XxRkBbSFibEqo7YVQ5 C0G3iVtNmLo= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id B45821FD92; Fri, 24 Jun 2016 13:13:09 -0400 (EDT) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id ECACC1FD91; Fri, 24 Jun 2016 13:13:08 -0400 (EDT) In-Reply-To: <20160624170038.GG1170@fysh.org> (zefram@fysh.org's message of "Fri, 24 Jun 2016 18:00:38 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: EC6EB83C-3A2E-11E6-9B6E-C1836462E9F6-02397024!pb-sasl1.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8240 Archived-At: --=-=-= Content-Type: text/plain On Fri 24 Jun 2016 19:00, Zefram writes: > Andy Wingo wrote: >> ,opt (let* ((x (list 'a)) >> (y (list 'a))) >> (list x y)) >> ;; -> >> (let* ((x (list 'a)) (y x)) (list x y)) > > Wow, that's a scary level of wrongitude. Indeed :/ Fixed in git with this patch: --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=0001-Fix-bug-that-exposed-list-invocations-to-CSE.patch >From ea352d9e54793783a8272863748ea6d31b3f7295 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 24 Jun 2016 19:03:36 +0200 Subject: [PATCH] Fix bug that exposed `list' invocations to CSE * module/language/tree-il/effects.scm (make-effects-analyzer): Fix analysis for list, cons, make-prompt-tage, and vector; &allocation is a `cause' effect. Fixes #21899. * test-suite/tests/cse.test ("cse"): Add test case. --- module/language/tree-il/effects.scm | 8 ++++---- test-suite/tests/cse.test | 9 +++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/module/language/tree-il/effects.scm b/module/language/tree-il/effects.scm index 1fe4aeb..6db4d47 100644 --- a/module/language/tree-il/effects.scm +++ b/module/language/tree-il/effects.scm @@ -278,16 +278,16 @@ of an expression." ;; Primitives that allocate memory. (($ _ ($ _ 'cons) (x y)) (logior (compute-effects x) (compute-effects y) - &allocation)) + (cause &allocation))) (($ _ ($ _ (or 'list 'vector)) args) - (logior (accumulate-effects args) &allocation)) + (logior (accumulate-effects args) (cause &allocation))) (($ _ ($ _ 'make-prompt-tag) ()) - &allocation) + (cause &allocation)) (($ _ ($ _ 'make-prompt-tag) (arg)) - (logior (compute-effects arg) &allocation)) + (logior (compute-effects arg) (cause &allocation))) ;; Primitives that are normally effect-free, but which might ;; cause type checks, allocate memory, or access mutable diff --git a/test-suite/tests/cse.test b/test-suite/tests/cse.test index e0219e8..ca7dbc2 100644 --- a/test-suite/tests/cse.test +++ b/test-suite/tests/cse.test @@ -294,6 +294,15 @@ (apply (primitive cons) (const 1) (const 2) (const 3)) (const 4))) + ;; The (list 'a) does not propagate. + (pass-if-cse + (let* ((x (list 'a)) + (y (list 'a))) + (list x y)) + (let (x) (_) ((apply (primitive list) (const a))) + (let (y) (_) ((apply (primitive list) (const a))) + (apply (primitive list) (lexical x _) (lexical y _))))) + (pass-if "http://bugs.gnu.org/12883" ;; In 2.0.6, compiling this code would trigger an out-of-bounds ;; vlist access in CSE's traversal of its "database". -- 2.8.3 --=-=-=--