From: Brian Paul Date: Wed, 6 Aug 2008 02:00:59 +0000 (-0600) Subject: mesa: glsl: generate error for main(any args) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bf3040d4767702f09e042c58f0f5aa942ddb9a16;p=mesa.git mesa: glsl: generate error for main(any args) --- 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() */