Closed Bug 991012 Opened 6 years ago Closed 4 years ago

CID 1195278: Inequality comparison against NULL in jsopcode.cpp as found by Coverity

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: gkw, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, regression)

Coverity analysis of source code in js/src has found an inequality comparison against NULL issue, that probably happened in the past month.


*** CID 1195278:  Inequality comparison against NULL  (BAD_COMPARE)
/js/src/jsopcode.cpp: 1634 in <unnamed>::ExpressionDecompiler::quote(JSString *, unsigned int)()
1628         return sprinter.putString(str) >= 0;
1629     }
1630     
1631     bool
1632     ExpressionDecompiler::quote(JSString *s, uint32_t quote)
1633     {
>>>     CID 1195278:  Inequality comparison against NULL  (BAD_COMPARE)
>>>     Comparing pointer "QuoteString(&this->sprinter, s, quote)" against NULL using anything besides == or != is likely to be incorrect.
1634         return QuoteString(&sprinter, s, quote) >= 0;
1635     }
1636     
1637     JSAtom *
1638     ExpressionDecompiler::loadAtom(jsbytecode *pc)
1639     {

jorendorff, any thoughts on how to move forward here?
Flags: needinfo?(jorendorff)
Wow, nice find. coverity++
Summary: Inequality comparison against NULL in jsopcode.cpp as found by Coverity → CID 1195278: Inequality comparison against NULL in jsopcode.cpp as found by Coverity
Fixed by sunfish in commit fab2921f6306.
Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(jorendorff)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.