qt6-bb10/tests/auto/corelib/serialization/qtextstream
Giuseppe D'Angelo a2ef00ee82 QTextStream: fix UB calls to qAbs() with minimal arguments
QTextStream's operator<<(number) uses qAbs to extract the "absolute
value" of number, and passes that and the number's sign to an internal
formatting function. However qAbs is unsuitable for the task, because it
will fail if `number` is minimal, as it returns the same type of
its input.

Since we can afford to change the type of the result, call the private
qUnsignedAbs() function instead.

Change-Id: Ib813a199503f2d07c78bb76862ab2e15d68d0ec2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8f762b546fe6b2254029c4804a32d9ae6bbf4495)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b50f026c5586bb31d0611ca570a40e77d5e4eb43)
2025-01-29 18:51:30 +00:00
..
readAllStdinProcess Change license for tests files 2024-02-04 09:56:42 +01:00
readLineStdinProcess Change license for tests files 2024-02-04 09:56:42 +01:00
resources
stdinProcess Change license for tests files 2024-02-04 09:56:42 +01:00
test
.gitattributes
.gitignore
BLACKLIST
CMakeLists.txt
REUSE.toml Add REUSE.toml files 2024-11-07 08:38:49 +01:00
qtextstream.qrc
qtextstream_integrity.qrc
rfc3261.txt
task113817.txt
tst_qtextstream.cpp QTextStream: fix UB calls to qAbs() with minimal arguments 2025-01-29 18:51:30 +00:00