diff options
author | jsjtxietian <jsjtxietian@outlook.com> | 2024-07-23 17:52:08 +0800 |
---|---|---|
committer | jsjtxietian <jsjtxietian@outlook.com> | 2024-07-26 11:53:11 +0800 |
commit | 38fad353568d4c986c82eaf26f371f6dff7d9c62 (patch) | |
tree | c8bebce46a8f7a064eeb09393db71fb82f75fbff /servers | |
parent | e343dbbcc1030f04dc5833f1c19d267a17332ca9 (diff) | |
download | redot-engine-38fad353568d4c986c82eaf26f371f6dff7d9c62.tar.gz |
Fix editor crash when shader has incorrect global array declaration
Diffstat (limited to 'servers')
-rw-r--r-- | servers/rendering/shader_language.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 745dcf5392..568aec2ff6 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -7411,6 +7411,9 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun return ERR_PARSE_ERROR; } tk = _get_token(); + } else { + _set_expected_error("("); + return ERR_PARSE_ERROR; } } } else { @@ -9520,6 +9523,9 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f _set_error(RTR("Array size mismatch.")); return ERR_PARSE_ERROR; } + } else { + _set_expected_error("("); + return ERR_PARSE_ERROR; } array_size = constant.array_size; |