Browse Source

Merge pull request #32903 from madmiraal/fix-27649-part9

Remove duplicate valid value check in gdscript_tokenizer.cpp.
Rémi Verschelde 5 years ago
parent
commit
e4cfb77961
1 changed files with 3 additions and 7 deletions
  1. 3 7
      modules/gdscript/gdscript_tokenizer.cpp

+ 3 - 7
modules/gdscript/gdscript_tokenizer.cpp

@@ -849,12 +849,8 @@ void GDScriptTokenizerText::_advance() {
 										_make_error("Unterminated String");
 										_make_error("Unterminated String");
 										return;
 										return;
 									}
 									}
-									if (!((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))) {
 
 
-										_make_error("Malformed hex constant in string");
-										return;
-									}
-									CharType v;
+									CharType v = 0;
 									if (c >= '0' && c <= '9') {
 									if (c >= '0' && c <= '9') {
 										v = c - '0';
 										v = c - '0';
 									} else if (c >= 'a' && c <= 'f') {
 									} else if (c >= 'a' && c <= 'f') {
@@ -864,8 +860,8 @@ void GDScriptTokenizerText::_advance() {
 										v = c - 'A';
 										v = c - 'A';
 										v += 10;
 										v += 10;
 									} else {
 									} else {
-										ERR_PRINT("BUG");
-										v = 0;
+										_make_error("Malformed hex constant in string");
+										return;
 									}
 									}
 
 
 									res <<= 4;
 									res <<= 4;