Missing "else" in nsMozIconURI::QueryInterface()
Categories
(Core :: Graphics: ImageLib, defect, P4)
Tracking
()
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: izbyshev, Assigned: ckerschb)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
It seems there is missing else
after https://searchfox.org/mozilla-central/rev/85ae3b91/image/decoders/icon/nsIconURI.cpp#63.
Reporter | ||
Updated•4 years ago
|
Comment 1•4 years ago
|
||
@Christoph: I think the code still executes as expected, but since the macros add the else it would be consistent.
Updated•4 years ago
|
Reporter | ||
Comment 2•4 years ago
|
||
I'm not familiar with XPCOM and FF codebase, but without else
foundInterface
is always overwritten by subsequent if
/else
statements. So even if it's not a bug, it looks strange.
Assignee | ||
Comment 3•4 years ago
|
||
I don't think the missing else
is a bug. Taking a closer look, the following statement:
if (aIID.Equals(kThisIconURIImplementationCID))
foundInterface = static_cast<nsIURI*>(this);
NS_INTERFACE_MAP_ENTRY(nsIMozIconURI)
When following the macro translation chain of NS_IMPL_QUERY_BODY will be translated to.
if (aIID.Equals(kThisIconURIImplementationCID))
foundInterface = static_cast<nsIURI*>(this);
if (aIID.Equals(NS_GET_IID(_interface)))
foundInterface = static_cast<_interface*>(this);
else
In other words, having an if
instead of an else if
will not influence the result here.
However, I realized we have a duplicate entry for NS_INTERFACE_MAP_ENTRY(nsIMozIconURI)
which I think was a mistake of Bug 1583044. Since we are already on it, we can add that else
statement so it's more consistent with other code in the tree, e..g within NullPrincipalURI.
Assignee | ||
Comment 4•4 years ago
|
||
Pushed by mozilla@christophkerschbaumer.com: https://hg.mozilla.org/integration/autoland/rev/6d0ef7321d81 Eliminate duplicate entry of nsIMozIconURI within nsIconURI and add and 'else' to be concistent with other code in the tree. r=valentin
Comment 6•4 years ago
|
||
bugherder |
Description
•