mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix crash in shader parsing
...that would happen if incorrect syntax was found just after an opening square bracket. Fixes #12046.
This commit is contained in:
parent
8de1dc7e9a
commit
7764640f22
1 changed files with 2 additions and 0 deletions
|
@ -2586,6 +2586,8 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
|
||||||
} else if (tk.type == TK_BRACKET_OPEN) {
|
} else if (tk.type == TK_BRACKET_OPEN) {
|
||||||
|
|
||||||
Node *index = _parse_and_reduce_expression(p_block, p_builtin_types);
|
Node *index = _parse_and_reduce_expression(p_block, p_builtin_types);
|
||||||
|
if (!index)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (index->get_datatype() != TYPE_INT && index->get_datatype() != TYPE_UINT) {
|
if (index->get_datatype() != TYPE_INT && index->get_datatype() != TYPE_UINT) {
|
||||||
_set_error("Only integer datatypes are allowed for indexing");
|
_set_error("Only integer datatypes are allowed for indexing");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue