summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qchar.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2020-05-08 22:46:44 +0200
committerMarc Mutz <marc.mutz@kdab.com>2020-05-09 08:24:31 +0200
commitc3b5efa250ee29413d348fea96e11b7e6f94e54f (patch)
treee1d5de8dc74b5bdaf28fca105c8d2e0ea4d33886 /src/corelib/text/qchar.cpp
parent3d58a6a0c8ef9067fa79df276a02621705690c10 (diff)
QString: fix UB in insert()
Comparing with <, >, <= or >= such pointers as are not pointing into the same array is UB. A clever compiler could look at the code, determine that the only valid execution is for it to return true, and just always take the copy. While that would be benign, it's not guaranteed that this would be the outcome (it's UB, after all), and, of course, we don't want to take the performance hit if we don't need it. Fix by using std::less, which guarantees a total ordering for all pointers. Pick-to: 5.15 Change-Id: If07b9363b2ecd573f259e4fa972b629362061ce5 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Diffstat (limited to 'src/corelib/text/qchar.cpp')
0 files changed, 0 insertions, 0 deletions