mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 22:21:18 +00:00
Disallow assignment to expressions
Fixes #6824 (cherry picked from commits0b077162a3anddcc4ee21c1)
This commit is contained in:
parent
6940830627
commit
4c9c43735a
1 changed files with 9 additions and 0 deletions
|
|
@ -1457,6 +1457,15 @@ GDParser::Node* GDParser::_reduce_expression(Node *p_node,bool p_to_const) {
|
|||
return op;
|
||||
}
|
||||
|
||||
if (op->arguments[0]->type==Node::TYPE_OPERATOR) {
|
||||
OperatorNode *on = static_cast<OperatorNode*>(op->arguments[0]);
|
||||
if (on->op != OperatorNode::OP_INDEX && on->op != OperatorNode::OP_INDEX_NAMED) {
|
||||
_set_error("Can't assign to an expression",tokenizer->get_token_line()-1);
|
||||
error_line=op->line;
|
||||
return op;
|
||||
}
|
||||
}
|
||||
|
||||
} break;
|
||||
default: { break; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue