summaryrefslogtreecommitdiff
path: root/layout/style/nsCSSParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layout/style/nsCSSParser.cpp')
-rw-r--r--layout/style/nsCSSParser.cpp39
1 files changed, 27 insertions, 12 deletions
diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp
index 6187b08e0..8b9e25066 100644
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -9843,7 +9843,22 @@ CSSParserImpl::ParseGridLine(nsCSSValue& aValue)
// Make the contained value be defined even though we really want a
// Nothing here. This works around an otherwise difficult to avoid
// Memcheck false positive when this is compiled by gcc-5.3 -O2.
- // See bug 1301856.
+ // The problem is that gcc 5.4 and later, when using high
+ // optimization, inline Maybe::{isSome,ref} here
+ //
+ // if (integer.isSome() && integer.ref() < 0) {
+ //
+ // and then proceed to evaluate the expression right-to-left, as if it
+ // had been written
+ //
+ // integer.ref() < 0 && integer.isSome()
+ //
+ // This is a legitimate transformation because gcc presumably can prove
+ // via dataflow analysis that integer.isSome() is false whenever integer.ref()
+ // is undefined, so the overall expression result is still defined.
+ // Valgrind/Memcheck assumes that all conditional branches in the program
+ // are important, and that assumption is deeply wired in, so there is no
+ // easy way to avoid the warning apart from to force-initialise |integer|.
integer.emplace(0);
integer.reset();
#endif
@@ -15314,17 +15329,17 @@ CSSParserImpl::ParseFontFeatureSettings(nsCSSValue& aValue)
return true;
}
-bool
-CSSParserImpl::ParseFontVariationSettings(nsCSSValue& aValue)
-{
- // TODO: Actually implement this.
-
- // This stub is here because websites insist on considering this
- // very hardware-dependent and O.S.-variable low-level font-control
- // as a "critical feature" which it isn't as there is 0 guarantee
- // that font variation settings are supported or honored by any
- // operating system used by the client.
- return true;
+bool
+CSSParserImpl::ParseFontVariationSettings(nsCSSValue& aValue)
+{
+ // TODO: Actually implement this.
+
+ // This stub is here because websites insist on considering this
+ // very hardware-dependent and O.S.-variable low-level font-control
+ // as a "critical feature" which it isn't as there is 0 guarantee
+ // that font variation settings are supported or honored by any
+ // operating system used by the client.
+ return true;
}
bool