aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4string_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-01-03 12:57:31 +0100
committerLars Knoll <lars.knoll@qt.io>2018-01-10 07:53:29 +0000
commitaf1565852b0701964ee3b9de1d094b6b89e44d45 (patch)
treecb99d841f954f3be8ab9a211d4b5f0915de67848 /src/qml/jsruntime/qv4string_p.h
parentebf024a136b5d9950c0b17ce64363bd23be2f637 (diff)
Fix calculation of String hash values for char *
If char is signed on the platform and the char * array contained non ascii values, this would actually miscompute the hash value Change-Id: Id26891482831bcc23c5ce61e8094a85b53d00a1c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4string_p.h')
-rw-r--r--src/qml/jsruntime/qv4string_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h
index 9053d9d48f..1acdbf3e4b 100644
--- a/src/qml/jsruntime/qv4string_p.h
+++ b/src/qml/jsruntime/qv4string_p.h
@@ -216,7 +216,7 @@ public:
private:
static inline uint toUInt(const QChar *ch) { return ch->unicode(); }
- static inline uint toUInt(const char *ch) { return *ch; }
+ static inline uint toUInt(const char *ch) { return static_cast<unsigned char>(*ch); }
template <typename T>
static inline uint toArrayIndex(const T *ch, const T *end)