glsl: bail out early in _mesa_ShaderSource if no shaderobj
authorTapani Pälli <tapani.palli@intel.com>
Tue, 22 Sep 2015 11:34:11 +0000 (14:34 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Wed, 23 Sep 2015 05:45:00 +0000 (08:45 +0300)
commit89524e717147053fe9da6e30daa0aaffcd29d26d
treef3bfe5869cb58a5fa02030d96d5527c7408d68e4
parent10da96887c785930c2553b2d5bde91e52b8b034a
glsl: bail out early in _mesa_ShaderSource if no shaderobj

Patch fixes a crash in conformance test that tries out different
invalid arguments for glShaderSource and glGetShaderSource:

   ES2-CTS.gtf.GL.glGetShaderSource.getshadersource_programhandle

This is a regression from commit:
   04e201d0c02cd30ace5c6fe80e9f021ebb733682

Additions in v2 also fix following failing deqp test:
   dEQP-GLES[2|3].functional.negative_api.shader.shader_source

v2: cleanup function, do check earlier (Iago Toral)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/main/shaderapi.c