summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-06-15 17:40:25 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-06-18 12:59:05 +0000
commitf5f98da54e1140cfc340e5077735c63d209edd7d (patch)
tree8dc833369c604530fd4b8037da63f28ce1a6ef32 /src
parentda8701ff57c24127a81bf7c8c61bc09e6a214c3b (diff)
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 <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/json/qjson_p.h2
1 files changed, 1 insertions, 1 deletions
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 {