Bug 746740 - GetProgramInfoLog should return null on GL error - r=bjacob
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 30 May 2012 16:05:37 -0700
changeset 95302 869482fb63a0293e36518b42e15222e30344df85
parent 95301 4c96e5b05cb7d4642eaccf1a6319d357b013a82c
child 95303 970abbd6e5b0aac52fc7536885e54f4779c5e221
push id10053
push userjgilbert@mozilla.com
push dateWed, 30 May 2012 23:05:50 +0000
treeherdermozilla-inbound@869482fb63a0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob
bugs746740
milestone15.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 746740 - GetProgramInfoLog should return null on GL error - r=bjacob
content/canvas/src/WebGLContextGL.cpp
--- a/content/canvas/src/WebGLContextGL.cpp
+++ b/content/canvas/src/WebGLContextGL.cpp
@@ -3019,18 +3019,20 @@ WebGLContext::GetProgramInfoLog(WebGLPro
         
     WebGLuint progname = prog->GLName();
 
     MakeContextCurrent();
 
     GLint k = -1;
     gl->fGetProgramiv(progname, LOCAL_GL_INFO_LOG_LENGTH, &k);
     if (k == -1) {
-        // XXX GL error? shouldn't happen!
-        rv = NS_ERROR_FAILURE;
+        // If GetProgramiv doesn't modify |k|,
+        // it's because there was a GL error.
+        // GetProgramInfoLog should return null on error. (Bug 746740)
+        retval.SetIsVoid(true);
         return;
     }
 
     if (k == 0) {
         retval.Truncate();
         return;
     }