Bug 1289098 - Fixes to avoid Valgrind false positives with gcc-5.4 -O2 builds. r=dbaron.

--HG--
extra : rebase_source : 489e0686b650f329c41bc5d2c2504ac308b9541d
This commit is contained in:
Julian Seward 2016-08-16 11:05:08 +02:00
parent 1fc6ff6493
commit 0749ba9357
2 changed files with 8 additions and 2 deletions

View File

@ -1148,7 +1148,10 @@ nsStyleContext::CalcStyleDifferenceInternal(StyleContextLike* aNewContext,
const nsStyleOutline *thisVisOutline = thisVis->StyleOutline();
const nsStyleOutline *otherVisOutline = otherVis->StyleOutline();
bool haveColor;
nscolor thisColor, otherColor;
// Dummy initialisations to keep Valgrind/Memcheck happy.
// See bug 1289098 comment 1.
nscolor thisColor = NS_RGBA(0, 0, 0, 0);
nscolor otherColor = NS_RGBA(0, 0, 0, 0);
if (thisVisOutline->GetOutlineInitialColor() !=
otherVisOutline->GetOutlineInitialColor() ||
(haveColor = thisVisOutline->GetOutlineColor(thisColor)) !=

View File

@ -3698,7 +3698,10 @@ nsStyleTextReset::CalcDifference(const nsStyleTextReset& aNewData) const
}
// Repaint for decoration color changes
nscolor decColor, otherDecColor;
// Dummy initialisations to keep Valgrind/Memcheck happy.
// See bug 1289098 comment 1.
nscolor decColor = NS_RGBA(0, 0, 0, 0);
nscolor otherDecColor = NS_RGBA(0, 0, 0, 0);
bool isFG, otherIsFG;
GetDecorationColor(decColor, isFG);
aNewData.GetDecorationColor(otherDecColor, otherIsFG);