diff options
author | Brian Paul <[email protected]> | 2008-08-05 20:00:59 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-08-05 20:57:17 -0600 |
commit | bf3040d4767702f09e042c58f0f5aa942ddb9a16 (patch) | |
tree | ff3e4cf69c6067c966184fef0849f5b535aac103 /src/mesa | |
parent | ab0d13dd60c707f2c414fa9fe8e489a9e24a8aee (diff) |
mesa: glsl: generate error for main(any args)
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/shader/slang/slang_compile.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 82df9b95d32..5ce0e2e3210 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2025,6 +2025,12 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit, A.vartable = o.vartable; A.log = C->L; + /* main() takes no parameters */ + if (mainFunc->param_count > 0) { + slang_info_log_error(A.log, "main() takes no arguments"); + return GL_FALSE; + } + _slang_codegen_function(&A, mainFunc); shader->Main = GL_TRUE; /* this shader defines main() */ |