Browse Source

Merge pull request #38609 from ThakeeNathees/range-crash-with-non-numeric-const-fix

range() with non-numeric const argument crash fix
Rémi Verschelde 5 years ago
parent
commit
e7c9d81876
1 changed files with 2 additions and 0 deletions
  1. 2 0
      modules/gdscript/gdscript_parser.cpp

+ 2 - 0
modules/gdscript/gdscript_parser.cpp

@@ -3304,6 +3304,8 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
 								ConstantNode *c = static_cast<ConstantNode *>(op->arguments[i]);
 								ConstantNode *c = static_cast<ConstantNode *>(op->arguments[i]);
 								if (c->value.get_type() == Variant::FLOAT || c->value.get_type() == Variant::INT) {
 								if (c->value.get_type() == Variant::FLOAT || c->value.get_type() == Variant::INT) {
 									constants.push_back(c->value);
 									constants.push_back(c->value);
+								} else {
+									constant = false;
 								}
 								}
 							} else {
 							} else {
 								constant = false;
 								constant = false;