diff options
Diffstat (limited to 'src/json.c')
| -rw-r--r-- | src/json.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/json.c b/src/json.c index 928825e034c..16500bce72d 100644 --- a/src/json.c +++ b/src/json.c | |||
| @@ -495,14 +495,7 @@ lisp_to_json (Lisp_Object lisp, struct json_configuration *conf) | |||
| 495 | else if (EQ (lisp, Qt)) | 495 | else if (EQ (lisp, Qt)) |
| 496 | return json_check (json_true ()); | 496 | return json_check (json_true ()); |
| 497 | else if (INTEGERP (lisp)) | 497 | else if (INTEGERP (lisp)) |
| 498 | { | 498 | return json_check (json_integer (INTEGER_TO_INT (lisp, json_int_t))); |
| 499 | intmax_t low = TYPE_MINIMUM (json_int_t); | ||
| 500 | intmax_t high = TYPE_MAXIMUM (json_int_t); | ||
| 501 | intmax_t value; | ||
| 502 | if (! integer_to_intmax (lisp, &value) || value < low || high < value) | ||
| 503 | args_out_of_range_3 (lisp, make_int (low), make_int (high)); | ||
| 504 | return json_check (json_integer (value)); | ||
| 505 | } | ||
| 506 | else if (FLOATP (lisp)) | 499 | else if (FLOATP (lisp)) |
| 507 | return json_check (json_real (XFLOAT_DATA (lisp))); | 500 | return json_check (json_real (XFLOAT_DATA (lisp))); |
| 508 | else if (STRINGP (lisp)) | 501 | else if (STRINGP (lisp)) |