From da15e10bd0997fb5c1a61cad7fdfe0786fec17e9 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 11 Oct 2015 23:08:43 -0700 Subject: [PATCH] Accept only bitwise identical NaN values in jv_identical (fix #978) --- src/jv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jv.c b/src/jv.c index 9c6a868..e064baf 100644 --- a/src/jv.c +++ b/src/jv.c @@ -1303,7 +1303,7 @@ int jv_identical(jv a, jv b) { r = a.u.ptr == b.u.ptr; break; case JV_KIND_NUMBER: - r = a.u.number == b.u.number || (isnan(a.u.number) && isnan(b.u.number)); + r = memcmp(&a.u.number, &b.u.number, sizeof(a.u.number)) == 0; break; default: r = 1; -- 2.40.0