rudolph-miller / jonathan

JSON encoder and decoder.
http://rudolph-miller.github.io/jonathan/overview.html
164 stars 24 forks source link

Library is unable to parse float if SAFETY restricted to 2 or 3 on SBCL #66

Open svetlyak40wt opened 3 years ago

svetlyak40wt commented 3 years ago

Here is how to reproduce the problem:

CL-USER> (asdf:load-system :jonathan)

CL-USER> (jonathan:parse "{\"foo\": 123.56}")
(:|foo| 123.56)

CL-USER> (sb-ext:restrict-compiler-policy 'safety 3)

CL-USER> (asdf:load-system :jonathan :force t)

CL-USER> (jonathan:parse "{\"foo\": 123.56}")
; Debugger entered on #<TYPE-ERROR expected-type: FIXNUM datum: 123.56>

The problem is in this line: https://github.com/Rudolph-Miller/jonathan/blame/fb83ff094d330b2208b0febc8b25983c6050e378/src/decode.lisp#L295

svetlyak40wt commented 3 years ago

This problem still exists the problem is in the (the fixnum num) form at line:

https://github.com/Rudolph-Miller/jonathan/blob/fb83ff094d330b2208b0febc8b25983c6050e378/src/decode.lisp#L295

fade commented 2 years ago

this just bit me pretty deep in my call graph.