From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pierre Lorenzon Newsgroups: gmane.emacs.bugs Subject: bug#20914: eieio/slot/group Date: Mon, 29 Jun 2015 19:29:52 +0200 (CEST) Message-ID: <20150629.192952.75170699401312078.devel@pollock-nageoire.net> References: <20150628.080243.1733196053784095862.devel@pollock-nageoire.net> <20150629.063137.1610262414319480638.devel@pollock-nageoire.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Mon_Jun_29_19_29_52_2015_111)--" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1435599631 5548 80.91.229.3 (29 Jun 2015 17:40:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Jun 2015 17:40:31 +0000 (UTC) To: 20914@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 29 19:40:20 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Z9d2Y-00045q-KL for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jun 2015 19:40:18 +0200 Original-Received: from localhost ([::1]:43401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9d2X-0008JT-PN for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jun 2015 13:40:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9d2O-0008Gf-RC for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 13:40:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9d2L-000630-3o for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 13:40:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9d2L-00062V-1L for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 13:40:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z9d2K-0004mX-5O for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 13:40:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pierre Lorenzon Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Jun 2015 17:40:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20914 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20914-submit@debbugs.gnu.org id=B20914.143559956618327 (code B ref 20914); Mon, 29 Jun 2015 17:40:03 +0000 Original-Received: (at 20914) by debbugs.gnu.org; 29 Jun 2015 17:39:26 +0000 Original-Received: from localhost ([127.0.0.1]:33280 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9d1h-0004lW-Pp for submit@debbugs.gnu.org; Mon, 29 Jun 2015 13:39:26 -0400 Original-Received: from smtp01.smtpout.orange.fr ([80.12.242.123]:33809 helo=smtp.smtpout.orange.fr) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9d1f-0004lG-9s for 20914@debbugs.gnu.org; Mon, 29 Jun 2015 13:39:24 -0400 Original-Received: from localhost ([83.202.246.69]) by mwinf5d48 with ME id mHfG1q00G1WaFzF03HfGPi; Mon, 29 Jun 2015 19:39:17 +0200 X-ME-Helo: localhost X-ME-Date: Mon, 29 Jun 2015 19:39:17 +0200 X-ME-IP: 83.202.246.69 In-Reply-To: <20150629.063137.1610262414319480638.devel@pollock-nageoire.net> X-Mailer: Mew version 6.5 on Emacs 25.0.50 / Mule 6.0 (HANACHIRUSATO) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104508 Archived-At: ----Next_Part(Mon_Jun_29_19_29_52_2015_111)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit OK I got it ! The problem comes from use of `copy-sequence' in `eieio-copy-parents-into-subclass' function of eieio-core. this copy is not reccursive as explained in code comment but it should be ! There's a joined patch that fixes the bug. Regards Pierre ----Next_Part(Mon_Jun_29_19_29_52_2015_111)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="eieio-core-0629.patch" --- eieio-core..orig.el 2015-06-28 07:26:49.000000000 +0200 +++ eieio-core.el 2015-06-29 19:20:28.000000000 +0200 @@ -660,9 +660,32 @@ (let ((pslots (eieio--class-slots pcv)) (pinit (eieio--class-initarg-tuples pcv))) (dotimes (i (length pslots)) - (let* ((sd (cl--copy-slot-descriptor (aref pslots i))) + ;;; -- Props should be copied as well + ;;; PLN Mon Jun 29 17:25:54 2015 + ;; + ;; Due to the way `cl--copy-slot-descriptor' acts + ;; props in the copied object will not be a new + ;; sequence but a reference to the parent + ;; sequence. Hence when modifying this sequence + ;; parent slot props will be altered as well : and it + ;; SHOULD NOT ! + ;; + (let* ((pslot (aref pslots i)) + (sd (cl--copy-slot-descriptor pslot)) (init (car (rassq (cl--slot-descriptor-name sd) pinit)))) + ;; + ;; Simply applying a `copy-sequence' on the props + ;; will not work since props itself is a sequence + ;; whose elements will not be copied and only + ;; reference elements of the old props plist. A + ;; reccursive copy should be performed. + ;; + (setf (cl--slot-descriptor-props sd) + (copy-tree + (cl--slot-descriptor-props pslot))) (eieio--add-new-slot newc sd init nil nil sn)) + ;; + ;;; -- End Props should be copied as well )) ;; while/let ;; Now duplicate all the class alloc slots. (let ((pcslots (eieio--class-class-slots pcv))) ----Next_Part(Mon_Jun_29_19_29_52_2015_111)----