[Webkit-unassigned] [Bug 196855] Fix Covscan uninitialized after ctor

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 15 09:00:49 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=196855

--- Comment #29 from Eike Rathke <erack at redhat.com> ---
Oh, you sort not initializing under coding style, ah well.. wasn't aware of that.


(In reply to Darin Adler from comment #24)
> > Source/JavaScriptCore/runtime/JSBigInt.h:246
> > +    unsigned m_length { 0 };
> 
> Not needed; as far as I can tell this is a coding style and "make the static
> checker happy" or future-proofing/safety measure rather than a correctness
> decision.
> 
> And I don’t understand which constructor Coverity is warning about here. I
> only see one constructor and it does initialize m_length.
As I mentioned, part of the patch are old covscan fixes that more or less still
applied, if current code initializes things now then that is not caught and the
patch is moot. Our Covscan didn't run against master or versions more recent
than 2.22

This (patch outdated) is in particluar true for most if not all
Source/JavaScriptCore/ changes that were already submitted with bug #186798 or
changes submitted with bug #190468 (both which I now have access to, thanks).

As mentioned, I'll submit a new patch that omits those old changes and contains
only newer fixes to not duplicate work, and I'll check the changes against
these comments before submitting and weed out the "style only" ones.


> > Source/WebCore/Modules/webaudio/AudioProcessingEvent.h:61
> > +    double m_playbackTime { 0.0 };
> 
> Not sure that 0 is the correct default value here. Would be good to have a
> test covering this.
Current code on master has
AudioProcessingEvent::AudioProcessingEvent() = default;
so either initializing with 0.0 is correct (and could be omitted) or it needs
an explicit different value anyway.


> > Source/WebCore/animation/DeclarativeAnimation.h:95
> > +    double m_previousIteration { 0.0 };
> 
> I think NAN is a better default here than 0. Not sure.
It's used in DeclarativeAnimation::invalidateDOMEvents() line 284

  else if (wasActive && isActive && m_previousIteration != iteration)

where a NaN would compare to always false with operator!=(), which in this case
would be ok. (if no one introduces comparisons with operator<() or operator>())

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190415/49b6033a/attachment.html>


More information about the webkit-unassigned mailing list