Skip to content

Commit

Permalink
Assert that dereferenced pointer is never nullptr
Browse files Browse the repository at this point in the history
It can't be, since then 'o' (which is never nullptr) would be different,
and we'd return in the previous line.

Since we test for d->popup a few lines above, help clang static analyzer
to not report this with hash
27ff831d79d1779825fd964239cbefe7.

Pick-to: 6.1
Change-Id: I9f0b14bd88418b897cee2d7a63e8a10fc4a0b01c
Reviewed-by: Richard Moe Gustavsen <[email protected]>
  • Loading branch information
vohi committed Feb 24, 2021
1 parent 10b3681 commit f6c9dec
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/widgets/util/qcompleter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,7 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e)
if (o != d->popup)
return QObject::eventFilter(o, e);

Q_ASSERT(d->popup);
switch (e->type()) {
case QEvent::KeyPress: {
QKeyEvent *ke = static_cast<QKeyEvent *>(e);
Expand Down

0 comments on commit f6c9dec

Please sign in to comment.