You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Disallow assignment to expressions
Fixes #6824 (cherry picked from commits0b077162a3anddcc4ee21c1)
This commit is contained in:
committed by
Rémi Verschelde
parent
6940830627
commit
4c9c43735a
@@ -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; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user