Merge pull request #97481 from Chaosus/shader_fix_void_return
Fix shader crash when return a void function call
This commit is contained in:
commit
b64b464ba7
1 changed files with 5 additions and 0 deletions
|
@ -8476,6 +8476,11 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun
|
||||||
return ERR_PARSE_ERROR;
|
return ERR_PARSE_ERROR;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (b->parent_function->return_type == TYPE_VOID) {
|
||||||
|
_set_error(vformat(RTR("'%s' function cannot return a value."), "void"));
|
||||||
|
return ERR_PARSE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
_set_tkpos(pos); //rollback, wants expression
|
_set_tkpos(pos); //rollback, wants expression
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
|
|
Loading…
Reference in a new issue