Mesa (master): glsl: Fix regression in function out-parameter lvalue detection.
Eric Anholt
anholt at kemper.freedesktop.org
Fri May 4 21:21:28 UTC 2012
Module: Mesa
Branch: master
Commit: 4595288ba844def45cc858fab44fad3efa1ab4c8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4595288ba844def45cc858fab44fad3efa1ab4c8
Author: Eric Anholt <eric at anholt.net>
Date: Mon Apr 23 17:24:13 2012 -0700
glsl: Fix regression in function out-parameter lvalue detection.
When doing the var->assigned change in
f2475ca424f7e001be50f64dafa5700f6603d684, I overzealously indented the
second block of code into the "if (var)" test. Revert these blocks to
the way they were before, just taking advantage of "var" to avoid
re-calling variable_referenced().
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49066
---
src/glsl/ast_function.cpp | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index 8bf0ba2..58cf685 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -153,21 +153,21 @@ verify_parameter_modes(_mesa_glsl_parse_state *state,
}
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;
- }
+ if (var)
var->assigned = true;
+
+ if (var && 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;
}
}
More information about the mesa-commit
mailing list