diff options
author | Shane Kearns <shane.kearns@sosco.com> | 2009-11-04 17:20:36 (GMT) |
---|---|---|
committer | mread <qt-info@nokia.com> | 2010-09-30 14:48:24 (GMT) |
commit | 9b158b5c64e15b79b4399bd53d026fdaeb492ade (patch) | |
tree | 0f6f45e528e7c202b7c53d14ea7a0258645c532b | |
parent | 56d6fdb40aaaa010f9d4badb41a0caf72ae324f0 (diff) | |
download | Qt-9b158b5c64e15b79b4399bd53d026fdaeb492ade.zip Qt-9b158b5c64e15b79b4399bd53d026fdaeb492ade.tar.gz Qt-9b158b5c64e15b79b4399bd53d026fdaeb492ade.tar.bz2 |
Fix bug where negative numbers are cast to unsigned and added as an offset
It worked, but relied on integer overflow and casting behaviour
Task-number: QT-3967
Reviewed-by: mread
-rw-r--r-- | src/corelib/arch/symbian/dla_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/arch/symbian/dla_p.h b/src/corelib/arch/symbian/dla_p.h index 0f4b501..33344ef 100644 --- a/src/corelib/arch/symbian/dla_p.h +++ b/src/corelib/arch/symbian/dla_p.h @@ -1027,7 +1027,7 @@ struct malloc_params { {return unsigned(addr)&(aln-1);} template <class T1, class T2> inline int ptrdiff(const T1* a1, const T2* a2) {return reinterpret_cast<const unsigned char*>(a1) - reinterpret_cast<const unsigned char*>(a2);} - template <class T> inline T offset(T addr, unsigned ofs) + template <class T> inline T offset(T addr, signed ofs) {return T(unsigned(addr)+ofs);} class slabset { |