Open
Bug 1649114
Opened 5 years ago
Updated 3 years ago
static analysis wrongly consideres dom::Selection's pointer as nsCSSPseudoElements::selection function
Categories
(Developer Infrastructure :: Source Code Analysis, defect, P2)
Developer Infrastructure
Source Code Analysis
Tracking
(Not tracked)
NEW
People
(Reporter: Sylvestre, Unassigned)
References
(Blocks 1 open bug)
Details
https://searchfox.org/mozilla-central/source/dom/events/TextComposition.cpp#688-692
A static analyzer is complaining about if (!selection) {
with:
prefix with the address-of operator to silence this warning
address of function 'nsCSSPseudoElements::selection' will always evaluate to 'true'
masayuki, we should remove this check as it is misleading.
wdyt?
Flags: needinfo?(masayuki)
Comment 1•5 years ago
|
||
I think that is a bug in the static analyzer. selection
is clearly a local variable, not the nsCSSPseudoElements::selection
function.
Comment 2•5 years ago
|
||
Yeah, it's dom::Selection
's pointer. I don't understand why it's considered as nsCSSPseudoElements::selection
. And the check is reasonable if we put off creating Selection
instances at first use.
Flags: needinfo?(masayuki)
Updated•5 years ago
|
Component: DOM: Editor → Source Code Analysis
Product: Core → Firefox Build System
Summary: address of function 'nsCSSPseudoElements::selection' will always evaluate to 'true' → static analysis wrongly consideres dom::Selection's pointer as nsCSSPseudoElements::selection function
Comment 3•5 years ago
|
||
The severity field is not set for this bug.
:andi, could you have a look please?
For more information, please visit auto_nag documentation.
Flags: needinfo?(bpostelnicu)
Updated•5 years ago
|
Severity: -- → S2
Flags: needinfo?(bpostelnicu)
Priority: -- → P2
Updated•3 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•