summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-02-12 23:13:08 +0100
committerGitHub <noreply@github.com>2017-02-12 23:13:08 +0100
commit530de920d48e43d96502c70928d13683e5083857 (patch)
tree9cc11465fd8c85016b567b22e09666988f43841e /modules
parent53b7bbfccefe98060633a31ee8f3be3297fc3f15 (diff)
parentc71a6c6d71e6dc8dc0d6fe20c77ea2de612a9836 (diff)
Merge pull request #7723 from lonesurvivor/gdscript-range-fix
Fix parsing bug which causes range(variable) to crash the engine
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gd_parser.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index 34c39c8024..c1c1f5d5a9 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -2577,7 +2577,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
Vector<Node*> args;
Vector<double> constants;
- bool constant=true;
+ bool constant=false;
for(int i=1;i<op->arguments.size();i++) {
args.push_back(op->arguments[i]);
@@ -2585,13 +2585,12 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
ConstantNode *c = static_cast<ConstantNode*>(op->arguments[i]);
if (c->value.get_type()==Variant::REAL || c->value.get_type()==Variant::INT) {
constants.push_back(c->value);
- } else {
- constant=false;
+ constant=true;
}
}
}
- if (args.size()>0 || args.size()<4) {
+ if (args.size()>0 && args.size()<4) {
if (constant) {