diff --git a/dom/canvas/WebGLElementArrayCache.cpp b/dom/canvas/WebGLElementArrayCache.cpp index 0c2502809a3..41a198c2ca6 100644 --- a/dom/canvas/WebGLElementArrayCache.cpp +++ b/dom/canvas/WebGLElementArrayCache.cpp @@ -19,7 +19,10 @@ static void UpdateUpperBound(uint32_t* const out_upperBound, uint32_t newBound) { MOZ_ASSERT(out_upperBound); - *out_upperBound = std::max(*out_upperBound, newBound); + // Move *out_upperBound to a local variable to work around a false positive + // -Wuninitialized gcc warning about std::max() in PGO builds. + uint32_t upperBound = *out_upperBound; + *out_upperBound = std::max(upperBound, newBound); } /* WebGLElementArrayCacheTree contains most of the implementation of diff --git a/dom/canvas/compiledtest/TestWebGLElementArrayCache.cpp b/dom/canvas/compiledtest/TestWebGLElementArrayCache.cpp index 242cf4f2c1e..33567289808 100644 --- a/dom/canvas/compiledtest/TestWebGLElementArrayCache.cpp +++ b/dom/canvas/compiledtest/TestWebGLElementArrayCache.cpp @@ -115,7 +115,7 @@ CheckSanity() // ensure we exercise some nontrivial tree-walking T data[numElems] = {1,0,3,1,2,6,5,4}; // intentionally specify only 8 elements for now size_t numBytes = numElems * sizeof(T); - MOZ_ASSERT(numBytes == sizeof(data)); + MOZ_RELEASE_ASSERT(numBytes == sizeof(data)); GLenum type = GLType(); @@ -139,7 +139,7 @@ CheckSanity() CheckValidate(true, c, type, numElems, 0, numElems); CheckValidate(false, c, type, numElems - 1, 0, numElems); - MOZ_ASSERT(numElems > 10); + MOZ_RELEASE_ASSERT(numElems > 10); CheckValidate(true, c, type, numElems - 10, 10, numElems - 10); CheckValidate(false, c, type, numElems - 11, 10, numElems - 10); } @@ -156,7 +156,7 @@ CheckUintOverflow() // ensure we exercise some nontrivial tree-walking T data[numElems]; size_t numBytes = numElems * sizeof(T); - MOZ_ASSERT(numBytes == sizeof(data)); + MOZ_RELEASE_ASSERT(numBytes == sizeof(data)); GLenum type = GLType();