Bug 1122375 - Fixes to avoid Valgrind false positives with gcc-4.9.x -O2 builds (part 2). r=dbaron.

This commit is contained in:
Julian Seward 2015-01-20 10:43:55 +01:00
parent 72b7ab9d77
commit 2a794bd357

View File

@ -795,7 +795,10 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther,
const nsStyleBorder *otherVisBorder = otherVis->StyleBorder();
NS_FOR_CSS_SIDES(side) {
bool thisFG, otherFG;
nscolor thisColor, otherColor;
// Dummy initialisations to keep Valgrind/Memcheck happy.
// See bug 1122375 comment 4.
nscolor thisColor = NS_RGBA(0, 0, 0, 0);
nscolor otherColor = NS_RGBA(0, 0, 0, 0);
thisVisBorder->GetBorderColor(side, thisColor, thisFG);
otherVisBorder->GetBorderColor(side, otherColor, otherFG);
if (thisFG != otherFG || (!thisFG && thisColor != otherColor)) {
@ -835,7 +838,10 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther,
if (!change && PeekStyleTextReset()) {
const nsStyleTextReset *thisVisTextReset = thisVis->StyleTextReset();
const nsStyleTextReset *otherVisTextReset = otherVis->StyleTextReset();
nscolor thisVisDecColor, otherVisDecColor;
// Dummy initialisations to keep Valgrind/Memcheck happy.
// See bug 1122375 comment 4.
nscolor thisVisDecColor = NS_RGBA(0, 0, 0, 0);
nscolor otherVisDecColor = NS_RGBA(0, 0, 0, 0);
bool thisVisDecColorIsFG, otherVisDecColorIsFG;
thisVisTextReset->GetDecorationColor(thisVisDecColor,
thisVisDecColorIsFG);