summaryrefslogtreecommitdiff
path: root/servers/rendering/shader_language.cpp
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2022-04-03 09:52:41 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2022-04-03 09:55:04 +0300
commit0864c9abaa1dec1a8dcb4ddf65c80b86822383d3 (patch)
tree69e6fbb067cab0ed4b7a20c6325740b99d26303d /servers/rendering/shader_language.cpp
parent9c5818d21219cebb38350a477a4a6c09b1197785 (diff)
Fix incorrect parsing array's `length()` at return statement in shader
Diffstat (limited to 'servers/rendering/shader_language.cpp')
-rw-r--r--servers/rendering/shader_language.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp
index fa3e09f746..b299e7e8fc 100644
--- a/servers/rendering/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -5144,7 +5144,6 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
if (!call_expression) {
return nullptr;
}
- data_type = call_expression->get_datatype();
} else if (tk.type == TK_BRACKET_OPEN) { // indexing
index_expression = _parse_and_reduce_expression(p_block, p_function_info);
if (!index_expression) {
@@ -5598,15 +5597,13 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
if (p_block != nullptr) {
p_block->block_tag = SubClassTag::TAG_ARRAY;
}
- Node *call_expression = _parse_and_reduce_expression(p_block, p_function_info);
+ mn->call_expression = _parse_and_reduce_expression(p_block, p_function_info);
if (p_block != nullptr) {
p_block->block_tag = SubClassTag::TAG_GLOBAL;
}
- if (!call_expression) {
+ if (!mn->call_expression) {
return nullptr;
}
- mn->datatype = call_expression->get_datatype();
- mn->call_expression = call_expression;
} else if (tk.type == TK_BRACKET_OPEN) {
Node *index_expression = _parse_and_reduce_expression(p_block, p_function_info);
if (!index_expression) {