diff options
author | Brian Paul <[email protected]> | 2008-08-04 10:21:55 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-08-04 17:14:48 -0600 |
commit | e68a3ef1efc3873afb64acd15a0ea27a6ba54bda (patch) | |
tree | ae0717535fb5508e9cd2246dbee8c2af57fbd5a4 /src | |
parent | 7c59a2b5a2699207e25638ff5be6b9cfd64560cc (diff) |
mesa: glsl: added initializer size/type error checking
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/shader/slang/slang_codegen.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index ad9cf06e275..92c96bef9ee 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2687,11 +2687,12 @@ _slang_gen_declaration(slang_assemble_ctx *A, slang_operation *oper) if (!rhs) return NULL; - assert(rhs); + if (!rhs->Store || var->Store->Size != rhs->Store->Size) { + slang_info_log_error(A->log, "invalid assignment (wrong types)"); + return NULL; + } + init = new_node2(IR_MOVE, var, rhs); - /* - assert(rhs->Opcode != IR_SEQ); - */ n = new_seq(varDecl, init); } else { |