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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 16 03:34:34 PDT 2019


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

--- Comment #39 from Eike Rathke <erack at redhat.com> ---
Comment on attachment 367314
  --> https://bugs.webkit.org/attachment.cgi?id=367314
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=367314&action=review

>> Source/WebCore/accessibility/AccessibilityTableColumn.h:63
>> +    unsigned m_columnIndex { 0 };
> 
> Not clear to me that a 0 is an acceptable default here. I suppose initialized is better than not, but 0 can be initialized but incorrect.

AccessibilityTableColumn::headerObjectForSection() does

    unsigned numCols = section->numColumns();
    if (m_columnIndex >= numCols)
        return nullptr;

I guess any other initial value than 0 (if nothing was set with setColumnIndex()) would be unexpected.
Also

    for (int testCol = m_columnIndex; testCol >= 0; --testCol) {

starting with a greater value then would seem quite odd to me.

>> Source/WebCore/animation/DeclarativeAnimation.h:95
>> +    double m_previousIteration { 0.0 };
> 
> I think NAN is a better default here than 0. Not sure.

DeclarativeAnimation::invalidateDOMEvents() has

        else if (wasActive && isActive && m_previousIteration != iteration) {
            auto iterationBoundary = iteration;
            if (m_previousIteration > iteration)
                iterationBoundary++;

With NaN m_previousIteration != iteration is always true, m_previousIteration > iteration is always false, no matter what the value of iteration is (even if negative).
Just to point out, don't know what would be correct.

-- 
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/20190416/87411776/attachment.html>


More information about the webkit-unassigned mailing list