diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-10-22 13:51:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-22 13:51:28 +0200 |
commit | e4cfb7796195f21bfe2b8e4c192ad153bce4b07a (patch) | |
tree | 75ed2040094357f1dd8f0387df3a92cb6bc24c4c /modules/gdscript | |
parent | fddc60c85c087f34bdc8e4ca72c20f9d50007586 (diff) | |
parent | 5b96233c3449baa18e4005d879b673e7fd7b169a (diff) |
Merge pull request #32903 from madmiraal/fix-27649-part9
Remove duplicate valid value check in gdscript_tokenizer.cpp.
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_tokenizer.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index 8b20b0ff48..4730e9b6bc 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -849,12 +849,8 @@ void GDScriptTokenizerText::_advance() { _make_error("Unterminated String"); 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') { v = c - '0'; } else if (c >= 'a' && c <= 'f') { @@ -864,8 +860,8 @@ void GDScriptTokenizerText::_advance() { v = c - 'A'; v += 10; } else { - ERR_PRINT("BUG"); - v = 0; + _make_error("Malformed hex constant in string"); + return; } res <<= 4; |