summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/glsl/linker.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 2cbfd78ba0c..db1b76b3716 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -793,7 +793,7 @@ link_intrastage_shaders(struct gl_context *ctx,
return NULL;
}
- gl_shader *const linked = ctx->Driver.NewShader(NULL, 0, main->Type);
+ gl_shader *linked = ctx->Driver.NewShader(NULL, 0, main->Type);
linked->ir = new(linked) exec_list;
clone_ir_list(linked, linked->ir, main->ir);
@@ -840,7 +840,11 @@ link_intrastage_shaders(struct gl_context *ctx,
assert(idx == num_linking_shaders);
- link_function_calls(prog, linked, linking_shaders, num_linking_shaders);
+ if (!link_function_calls(prog, linked, linking_shaders,
+ num_linking_shaders)) {
+ ctx->Driver.DeleteShader(ctx, linked);
+ linked = NULL;
+ }
free(linking_shaders);