diff options
| author | Ahmad Samir <a.samirh78@gmail.com> | 2023-09-15 17:30:43 +0300 |
|---|---|---|
| committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-11-04 17:46:05 +0300 |
| commit | 4c6dfc05df4330c787bbb2a1b657dbcc944ca4ea (patch) | |
| tree | 7fdbb7da41a0c65e82ffeb8594338b2e80a83397 /src/corelib/kernel/qtimer.cpp | |
| parent | 04f4b27774ba70ebba425394fa8a1ffdffb2483b (diff) | |
QLatin1StringMatcher: handle `from` index < 0
indexIn() could hit UB if `from` < 0, so handle that case too. (This
also makes using noexcept for that method more correct wrt the Lakos
rule). While I think that passing valid indexes to a method is the
responsibility of the caller and that the existing API in Qt where a
negative index is interpretted as "search from the end" is
hard-to-use/bad API, not handling `from < 0` this way will most likely
not pass review (c.f. commit 81538c5219b92356c52233a80845847145795d6f on
gerrit). I'd rather get this over with so that an indexIn(QSV) overload
can be added...
Change-Id: Id85d18c901c82d9652804ecff7bfe7c71c10a63c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qtimer.cpp')
0 files changed, 0 insertions, 0 deletions
