projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de81726
)
check for attempted writes to read-only vars
author
Brian
<brian@yutani.localnet.net>
Thu, 8 Mar 2007 17:40:25 +0000
(10:40 -0700)
committer
Brian
<brian@yutani.localnet.net>
Thu, 8 Mar 2007 17:40:25 +0000
(10:40 -0700)
src/mesa/shader/slang/slang_codegen.c
patch
|
blob
|
history
diff --git
a/src/mesa/shader/slang/slang_codegen.c
b/src/mesa/shader/slang/slang_codegen.c
index 1c037d4304b610befb7305c47b76587ee6276dbc..b1b4616f638c568c3b62362ec632e4b31ce61b91 100644
(file)
--- a/
src/mesa/shader/slang/slang_codegen.c
+++ b/
src/mesa/shader/slang/slang_codegen.c
@@
-2007,6
+2007,12
@@
_slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
else {
slang_ir_node *n, *lhs, *rhs;
lhs = _slang_gen_operation(A, &oper->children[0]);
+ if (lhs->Store->File != PROGRAM_OUTPUT &&
+ lhs->Store->File != PROGRAM_TEMPORARY) {
+ slang_info_log_error(A->log, "Assignment to read-only variable");
+ return NULL;
+ }
+
rhs = _slang_gen_operation(A, &oper->children[1]);
if (lhs && rhs) {
/* convert lhs swizzle into writemask */