aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ast_function.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-04-20 17:39:30 +0200
committermarha <marha@users.sourceforge.net>2012-04-20 17:39:30 +0200
commitae228baa2cfe88bd7c7de40d5038ad2cc1ecffa4 (patch)
treeb18ae337e913f36a95f97530f6a792e9366a393c /mesalib/src/glsl/ast_function.cpp
parent4207bc7b2972aed9a45756fae8c48957d323fa21 (diff)
parent0e3699334faf92f508b6c187a261548b656b0dd3 (diff)
downloadvcxsrv-ae228baa2cfe88bd7c7de40d5038ad2cc1ecffa4.tar.gz
vcxsrv-ae228baa2cfe88bd7c7de40d5038ad2cc1ecffa4.tar.bz2
vcxsrv-ae228baa2cfe88bd7c7de40d5038ad2cc1ecffa4.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/dix/dispatch.c xorg-server/dix/resource.c
Diffstat (limited to 'mesalib/src/glsl/ast_function.cpp')
-rw-r--r--mesalib/src/glsl/ast_function.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/mesalib/src/glsl/ast_function.cpp b/mesalib/src/glsl/ast_function.cpp
index 39401017b..8bf0ba2a8 100644
--- a/mesalib/src/glsl/ast_function.cpp
+++ b/mesalib/src/glsl/ast_function.cpp
@@ -152,19 +152,22 @@ verify_parameter_modes(_mesa_glsl_parse_state *state,
return false;
}
- if (actual->variable_referenced()
- && actual->variable_referenced()->read_only) {
- _mesa_glsl_error(&loc, state,
- "function parameter '%s %s' references the "
- "read-only variable '%s'",
- mode, formal->name,
- actual->variable_referenced()->name);
- return false;
- } else if (!actual->is_lvalue()) {
- _mesa_glsl_error(&loc, state,
- "function parameter '%s %s' is not an lvalue",
- mode, formal->name);
- return false;
+ ir_variable *var = actual->variable_referenced();
+ if (var) {
+ if (var->read_only) {
+ _mesa_glsl_error(&loc, state,
+ "function parameter '%s %s' references the "
+ "read-only variable '%s'",
+ mode, formal->name,
+ actual->variable_referenced()->name);
+ return false;
+ } else if (!actual->is_lvalue()) {
+ _mesa_glsl_error(&loc, state,
+ "function parameter '%s %s' is not an lvalue",
+ mode, formal->name);
+ return false;
+ }
+ var->assigned = true;
}
}