From f5f98da54e1140cfc340e5077735c63d209edd7d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 15 Jun 2017 17:40:25 +0200 Subject: [PATCH] Fix reading qle_signedbitfield as int The type-cast to int for qle_signedbitfield was wrong for all cases where width + pos != 32. The class is currently only used two places though, both where that happen to apply. Change-Id: I108c565b75c9f29dd49b5e2e39f84910d17ead85 Reviewed-by: Lars Knoll --- src/corelib/json/qjson_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/json/qjson_p.h b/src/corelib/json/qjson_p.h index 0c78fadfc7..c012ec2662 100644 --- a/src/corelib/json/qjson_p.h +++ b/src/corelib/json/qjson_p.h @@ -243,7 +243,7 @@ public: uint i = qFromLittleEndian(val); i <<= 32 - width - pos; int t = (int) i; - t >>= pos; + t >>= 32 - width; return t; } bool operator !() const {