Opened 14 years ago

Closed 14 years ago

#85 closed defect (fixed)

CL-JSON throws an error under ABCL where SBCL doesn't.

Reported by: ehuelsmann Owned by: Mark Evenson
Priority: major Milestone: 0.19
Component: compiler Version:
Keywords: Cc:
Parent Tickets:

Description

The code is:

(require 'asdf)
(asdf:operate 'asdf:load-op :cl-json)
(json:decode-json-from-string

"{\"foo\": [10,20,50], \"bar\": true}")

The error message is: The value 50 is not of type CONS.

I'm using Yason as a work-around, but thought that you guys might want to know, maybe this points to a deeper issue.

Change History (4)

comment:1 Changed 14 years ago by Mark Evenson

Indeed it does point to something quite mysterious. After a couple hours of fiddling around, it seems that PROGV forms in nested function calls are somehow "leaking" the binding out to improper references.

I wasn't able to distill a test case outside of CL-JSON, but the following simpler form causes the same type of error:

(decode-json-from-string "{\"foo\": [1]}")

comment:2 Changed 14 years ago by Mark Evenson

Component: othercompiler
Owner: changed from somebody to ehuelsmann

A bug in the compiler, as EVAL-ing "decoder.lisp" does not show this bug.

comment:3 Changed 14 years ago by Mark Evenson

Owner: changed from ehuelsmann to Mark Evenson
Status: newassigned

Reproduction of the bug away from CL-JSON:

(defvar *a* "initial")

(defun foo ()
  (progv '(*a*) '((symbol-value '*a*))
    (setf *a* "foo")
    (return-from foo)))

(defun bar () 
  (format t "before: ~A~%" *a*)
  (foo)
  (format t "after: ~A~%" *a*))
  

Compiling and executing BAR shows

CL-USER> (bar)
before: initial
after: foo
NIL

Which shows that the special binding hasn't been reset.

comment:4 Changed 14 years ago by ehuelsmann

Milestone: 0.19
Resolution: fixed
Status: assignedclosed

Fixed in r12526.

Setting to 0.19 milestone as I propose backporting.

Note: See TracTickets for help on using tickets.