Bug 1525857 - Add release asserts for pre-crash cases. r=lsalzman
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 26 Feb 2019 02:54:08 +0000
changeset 518907 b36c070f066b2d17c4b3d871cfac28e9c1961e31
parent 518906 57f2a3550fafe52aeb94187337789cf354fd5e06
child 518908 62d66c338b8a4c4f59121bbf91e0b455c33eb404
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1525857
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1525857 - Add release asserts for pre-crash cases. r=lsalzman Differential Revision: https://phabricator.services.mozilla.com/D21145
dom/canvas/WebGLProgram.cpp
dom/canvas/WebGLShaderValidator.cpp
--- a/dom/canvas/WebGLProgram.cpp
+++ b/dom/canvas/WebGLProgram.cpp
@@ -468,16 +468,18 @@ static RefPtr<const webgl::LinkedProgram
       info->transformFeedbackVaryings.push_back(activeInfo);
     }
   }
 
   // Frag outputs
 
   {
     const auto& fragShader = prog->FragShader();
+    MOZ_RELEASE_ASSERT(fragShader);
+    MOZ_RELEASE_ASSERT(fragShader->Validator());
     const auto& handle = fragShader->Validator()->Handle();
     const auto version = sh::GetShaderVersion(handle);
 
     const auto fnAddInfo = [&](const webgl::FragOutputInfo& x) {
       info->fragOutputs.insert({x.loc, x});
     };
 
     if (version == 300) {
--- a/dom/canvas/WebGLShaderValidator.cpp
+++ b/dom/canvas/WebGLShaderValidator.cpp
@@ -208,16 +208,17 @@ webgl::ShaderValidator* WebGLContext::Cr
 
 namespace webgl {
 
 /*static*/ ShaderValidator* ShaderValidator::Create(
     GLenum shaderType, ShShaderSpec spec, ShShaderOutput outputLanguage,
     const ShBuiltInResources& resources, ShCompileOptions compileOptions) {
   ShHandle handle =
       sh::ConstructCompiler(shaderType, spec, outputLanguage, &resources);
+  MOZ_RELEASE_ASSERT(handle);
   if (!handle) return nullptr;
 
   return new ShaderValidator(handle, compileOptions,
                              resources.MaxVaryingVectors);
 }
 
 ShaderValidator::~ShaderValidator() { sh::Destruct(mHandle); }