diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-01-03 12:57:31 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-01-10 07:53:29 +0000 |
commit | af1565852b0701964ee3b9de1d094b6b89e44d45 (patch) | |
tree | cb99d841f954f3be8ab9a211d4b5f0915de67848 /src | |
parent | ebf024a136b5d9950c0b17ce64363bd23be2f637 (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')
-rw-r--r-- | src/qml/jsruntime/qv4string_p.h | 2 |
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) |