Closed Bug 1252039 Opened 4 years ago Closed 4 years ago

[Static Analysis][Operands don't affect result] In function SeparatorRequiredBetweenTokens

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1354490)

Attachments

(1 file)

The Static Analysis tool Coverity added that in the following context:

>>    default:
>>      MOZ_ASSERT(aToken1 == eCSSTokenSerialization_Nothing ||
>>                 aToken1 == eCSSTokenSerialization_Whitespace ||
>>                 aToken1 == eCSSTokenSerialization_Percentage ||
>>                 aToken1 == eCSSTokenSerialization_URL_or_BadURL ||
>>                 aToken1 == eCSSTokenSerialization_Function ||
>>                 aToken1 == eCSSTokenSerialization_CDC ||
>>                 aToken1 == eCSSTokenSerialization_Symbol_OpenParen ||
>>                 aToken1 == eCSSTokenSerialization_Symbol_Question ||
>>                 aToken1 == eCSSTokenSerialization_Symbol_Assorted ||
>>                 aToken1 == eCSSTokenSerialization_Symbol_Asterisk ||
>>                 aToken1 == eCSSTokenSerialization_Symbol_Equals ||
>>                 aToken1 == eCSSTokenSerialization_Symbol_Bar ||
>>                 aToken1 == eCSSTokenSerialization_Symbol_Slash ||
>>                 aToken1 == eCSSTokenSerialization_Other ||
>>                 "unexpected nsCSSTokenSerializationType value");
>>      return false;

operands don't affect the result since |"unexpected nsCSSTokenSerializationType value"| will always translate to a valid memory address thus the MOZ_ASSERT becoming useless.
Comment on attachment 8724678 [details]
MozReview Request: Bug 1252039 - corrected MOZ_ASSERT expression in SeparatorRequiredBetweenTokens. r?roc

https://reviewboard.mozilla.org/r/37115/#review33665
Attachment #8724678 - Flags: review+
Component: Layout → CSS Parsing and Computation
https://hg.mozilla.org/mozilla-central/rev/be813aef3471
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in before you can comment on or make changes to this bug.