[Ecls-list] Bug report: Byte compilation and setf functions...

Pascal Costanza pc at p-cos.net
Sat Nov 28 17:47:43 UTC 2009


Hi,

Consider the following:

> (setf (fdefinition '(setf foo))
        (coerce '(lambda (new-value x) (+ new-value x)) 'function))

#<bytecompiled-function 0000000101e00000>
> (setf (foo 5) 6)

11
> (defun test () 
    (setf (foo 5) 6))

TEST
> (test)

11
> (compile 'test)

;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;; End of Pass 1.
;;; Note: Invoking external command:
;;;   gcc "-I/usr/local/include/"  -g -O2 -fPIC -fno-common  -D_THREAD_SAFE -Ddarwin -O -w -c "/private/var/folders/Ax/AxAJIVcQ2RWA+E+8ZRgMbU+++TI/-Tmp-/ECL001alHMZE.c" -o "/private/var/folders/Ax/AxAJIVcQ2RWA+E+8ZRgMbU+++TI/-Tmp-/ECL001alHMZE.o"
;;; Note: Invoking external command:
;;;   gcc -o "/private/var/folders/Ax/AxAJIVcQ2RWA+E+8ZRgMbU+++TI/-Tmp-/ECL001alHMZE.fas" -L"/usr/local/lib/" "/private/var/folders/Ax/AxAJIVcQ2RWA+E+8ZRgMbU+++TI/-Tmp-/ECL001alHMZE.o"   -bundle    -lffi -lecl  -lpthread   -lm ld: warning: in /usr/local/lib//libffi.dylib, file is not of required architecture

TEST
NIL
NIL
> (test)

Detected access to an invalid or protected memory address.

Available restarts:

1. (RESTART-TOPLEVEL) Go back to Top-Level REPL.


If I use eval instead of coerce when assigning to (fdefinition '(setf foo)), this works...


Pascal

-- 
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium










More information about the ecl-devel mailing list