Skip to content

Draft: Change from vValue to vZero in FastRowProcessor

Before this commit, vValue in some cases would be read and assigned despite not being initialized. This commit ensures that in those cases a value of zero will be used instead.

CID 489657

Test Plan

Just asking Dmitry for intent on that line might be enough.

Might be that the code is fine and xsimd actually does initialize it, or it doesn't matter, but in that case, just throw it out and I'll mark the Coverity issue as Ignored. But it seemed serious enough (since it's in a core file) to make a MR out of it.

History:

I think the very old line was like this:

Vc::float_m excludeMask = d->fadeMaker.needFade(xr, yr);
        vValue(excludeMask) = vOne;

in a file added in 3aeeae38.

Then it was changed to this:

float_v vValue;

        // check if we need to apply fader on values
        float_m excludeMask = d->fadeMaker.needFade(xr, yr);
        vValue = xsimd::select(excludeMask, vOne, vValue);

It seems to be just during conversion from Vc to xsimd, here: 70863966.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.

Merge request reports