builder: fix conversion of double to OCaml (RHBZ#1270011).

Create the OCaml value for double using caml_copy_double, which is
the correct way, simplier, and works.
This commit is contained in:
Pino Toscano
2015-10-12 16:38:50 +02:00
parent 1f23a2c3a9
commit 753bf99f5c

View File

@@ -76,9 +76,8 @@ convert_yajl_value (yajl_val val, int level)
Store_field (rv, 0, v);
} else if (YAJL_IS_DOUBLE (val)) {
rv = caml_alloc (1, 2);
lv = caml_alloc_tuple (1);
Store_double_field (lv, 0, YAJL_GET_DOUBLE(val));
Store_field (rv, 0, lv);
v = caml_copy_double (YAJL_GET_DOUBLE(val));
Store_field (rv, 0, v);
} else if (YAJL_IS_INTEGER (val)) {
rv = caml_alloc (1, 1);
v = caml_copy_int64 (YAJL_GET_INTEGER(val));