summaryrefslogtreecommitdiff
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-08-11 16:58:25 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-08-11 16:58:25 -0700
commit202604e8160157e4e80b3458175e0170d168e557 (patch)
tree06bf0ef997206a5fd9034d818329d7eb3b27f49d /src/glsl/ast_to_hir.cpp
parentda6b10a7eb26c8a13056cbae9015d5b84f134142 (diff)
glsl2: Don't declare a variable called sig that shadows the other one
Accidentally having a variable called 'sig' within an if-statement cause the higher scope 'sig' to always be NULL. As a result a new function signature was created for a function definition even when one already existed from a prototype declaration. Fixes piglit test case glsl-function-prototype (bugzilla #29520).
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index f14341c8f7..9d4448f89a 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2128,7 +2128,7 @@ ast_function::hir(exec_list *instructions,
*/
f = state->symbols->get_function(name);
if (f != NULL) {
- ir_function_signature *sig = f->exact_matching_signature(&hir_parameters);
+ sig = f->exact_matching_signature(&hir_parameters);
if (sig != NULL) {
const char *badvar = sig->qualifiers_match(&hir_parameters);
if (badvar != NULL) {