jonathan icon indicating copy to clipboard operation
jonathan copied to clipboard

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

Open svetlyak40wt opened this issue 3 years ago • 2 comments

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 avatar Mar 06 '21 15:03 svetlyak40wt

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

svetlyak40wt avatar Oct 17 '21 10:10 svetlyak40wt

this just bit me pretty deep in my call graph.

fade avatar Nov 30 '21 21:11 fade