summaryrefslogtreecommitdiffstats
path: root/servers
diff options
context:
space:
mode:
authorjsjtxietian <jsjtxietian@outlook.com>2024-07-23 17:52:08 +0800
committerjsjtxietian <jsjtxietian@outlook.com>2024-07-26 11:53:11 +0800
commit38fad353568d4c986c82eaf26f371f6dff7d9c62 (patch)
treec8bebce46a8f7a064eeb09393db71fb82f75fbff /servers
parente343dbbcc1030f04dc5833f1c19d267a17332ca9 (diff)
downloadredot-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.cpp6
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;