diff options
author | Andreas Buhr <andreas.buhr@qt.io> | 2020-10-14 19:48:30 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-10-22 08:53:33 +0000 |
commit | c84b7154982f21c9332dccec6460a5f6abc379ce (patch) | |
tree | 4ac855c17cd4a403029b63423530f65d30791333 | |
parent | 087d7891aa54084236a27b5b77767e9d5106e108 (diff) |
Fix to make g++-10.2 happy
g++-10.2 fails to compile qregion.cpp in RelWithDebInfo configuration,
with error message:
qregion.cpp:3617:12: error: ‘ET.EdgeTable::ymax’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
g++ is right here, for Count==1, 'ET' is not initialized but used.
This patch fixes this by Q_ASSUMEing Count > 1.
Change-Id: I3b9f1f58de9f3811c60640a08334487e3f8f2b23
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit dd0647b17aa43bccf36285285ecccb54f18176ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/gui/painting/qregion.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index 2ecc97af04..13ffd93640 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -3647,6 +3647,8 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) POINTBLOCK *tmpPtBlock; int numFullPtBlocks = 0; + Q_ASSUME(Count > 1); + region = new QRegionPrivate; /* special case a rectangle */ |