[armedbear-ticket] [armedbear] #107: (setf (values (struct-slot struct)) (values 42)) fails
#107: (setf (values (struct-slot struct)) (values 42)) fails -------------------------------------+-------------------------------------- Reporter: mmohamed | Owner: somebody Type: defect | Status: new Priority: major | Milestone: Component: CLOS | Version: Keywords: SETF VALUES STRUCT-SLOT | -------------------------------------+-------------------------------------- ;;; reported by Zach Beane ;;; http://common-lisp.net/pipermail/armedbear- devel/2010-October/001521.html Here's a file that triggers an ABCL bug: ;;;; abcl-bug.lisp (defpackage #:abcl-bug (:use #:cl) (:export #:trigger)) (in-package #:abcl-bug) (defstruct mystruct slot) (defun trigger () (let ((struct (make-mystruct))) (setf (values (mystruct-slot struct)) (values 42)) struct)) Here's what happens when I run it: Armed Bear Common Lisp 0.22.0 Java 1.6.0_18 Sun Microsystems Inc. OpenJDK 64-Bit Server VM Low-level initialization completed in 0.445 seconds. Startup completed in 1.688 seconds. Type ":help" for a list of available commands. CL-USER(1): (load (compile-file "abcl-bug")) ; Compiling /tmp/abcl-bug.lisp ... ; (DEFPACKAGE #:ABCL-BUG ...) ; (IN-PACKAGE #:ABCL-BUG) ; (DEFSTRUCT MYSTRUCT ...) ; (DEFUN TRIGGER ...) ; Wrote /tmp/abcl-bug.abcl (0.447 seconds) T CL-USER(2): (abcl-bug:trigger) #<THREAD "interpreter" {1653033E}>: Debugger invoked on condition of type UNDEFINED-FUNCTION The function (SETF SYSTEM:STRUCTURE-REF) is undefined. Restarts: 0: TOP-LEVEL Return to top level. [1] CL-USER(3): :bt 0: (SYSTEM:BACKTRACE) 1: (INVOKE-DEBUGGER #<UNDEFINED-FUNCTION {8FE2509}>) 2: org.armedbear.lisp.Lisp.error(Lisp.java:353) 3: org.armedbear.lisp.Symbol.getSymbolSetfFunctionOrDie(Symbol.java:399) 4: org.armedbear.lisp.abcl_bug_9.execute(abcl-bug.lisp:11) 5: org.armedbear.lisp.LispThread.execute(LispThread.java:552) 6: org.armedbear.lisp.Lisp.evalCall(Lisp.java:514) 7: org.armedbear.lisp.Lisp.eval(Lisp.java:485) [1] CL-USER(4): I would expect to get a structure back with SLOT set to 42, instead of this error. This is a strange case (you normally wouldn't use VALUES there) but it comes from some larger real code that sets multiple struct slots from a multiple-value-returning function. -- Ticket URL: <http://trac.common-lisp.net/armedbear/ticket/107> armedbear <http://common-lisp.net/project/armedbear> armedbear
#107: (setf (values (struct-slot struct)) (values 42)) fails -------------------------+-------------------------------------------------- Reporter: mmohamed | Owner: somebody Type: defect | Status: closed Priority: minor | Milestone: Component: other | Version: Resolution: worksforme | Keywords: SETF VALUES STRUCT-SLOT -------------------------+-------------------------------------------------- Changes (by mmohamed): * priority: major => minor * resolution: => worksforme * status: new => closed * component: CLOS => other Comment: I am unable to confirm this. FWIW, I am running trunk ABCL with the patch for the long form of define-method-combination (#66) CL-USER> (in-package #:abcl-bug) #<PACKAGE "ABCL-BUG"> ABCL-BUG> (trigger) #S(MYSTRUCT :SLOT 42) ABCL-BUG> (lisp-implementation-type) "Armed Bear Common Lisp" ABCL-BUG> (lisp-implementation-version) "0.22.0-dev" ABCL-BUG> -- Ticket URL: <http://trac.common-lisp.net/armedbear/ticket/107#comment:1> armedbear <http://common-lisp.net/project/armedbear> armedbear
#107: (setf (values (struct-slot struct)) (values 42)) fails -----------------------+---------------------------------------------------- Reporter: mmohamed | Owner: somebody Type: defect | Status: reopened Priority: major | Milestone: Component: compiler | Version: Resolution: | Keywords: SETF VALUES STRUCT-SLOT -----------------------+---------------------------------------------------- Changes (by mmohamed): * priority: minor => major * resolution: worksforme => * status: closed => reopened * component: other => compiler Comment: Sorry folks; the interpreter is fine but the code is broken when compiled and loaded. Problem remains. -- Ticket URL: <http://trac.common-lisp.net/armedbear/ticket/107#comment:2> armedbear <http://common-lisp.net/project/armedbear> armedbear
#107: (setf (values (struct-slot struct)) (values 42)) fails -----------------------+---------------------------------------------------- Reporter: mmohamed | Owner: somebody Type: defect | Status: closed Priority: major | Milestone: Component: compiler | Version: Resolution: fixed | Keywords: SETF VALUES STRUCT-SLOT -----------------------+---------------------------------------------------- Changes (by ehuelsmann): * status: reopened => closed * resolution: => fixed Comment: (In [12935]) Fix #107: Incorrect compilation of (SETF STRUCTURE-REF) expansion. -- Ticket URL: <http://trac.common-lisp.net/armedbear/ticket/107#comment:3> armedbear <http://common-lisp.net/project/armedbear> armedbear
participants (1)
-
armedbear