diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2021-03-01 09:08:44 +0300 |
---|---|---|
committer | Yuri Roubinsky <chaosus89@gmail.com> | 2021-03-01 09:08:44 +0300 |
commit | 19e0a1ec9dce4d0a550a944bbd77f0db427dec78 (patch) | |
tree | 3e92028c8aa97006b9b7aec123ad705edb067cbc /servers/rendering | |
parent | 165d77a496f40fd87d85a75a8e6734f2ebec9d03 (diff) |
Fix parsing hexadecimal (lowercase `e`,`f`) in shaders
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/shader_language.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index cb98a71e86..e5978e4f1b 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -558,13 +558,13 @@ ShaderLanguage::Token ShaderLanguage::_get_token() { return _make_token(TK_ERROR, "Invalid numeric constant"); } hexa_found = true; - } else if (GETCHAR(i) == 'e') { - if (hexa_found || exponent_found || float_suffix_found) { + } else if (GETCHAR(i) == 'e' && !hexa_found) { + if (exponent_found || float_suffix_found) { return _make_token(TK_ERROR, "Invalid numeric constant"); } exponent_found = true; - } else if (GETCHAR(i) == 'f') { - if (hexa_found || exponent_found) { + } else if (GETCHAR(i) == 'f' && !hexa_found) { + if (exponent_found) { return _make_token(TK_ERROR, "Invalid numeric constant"); } float_suffix_found = true; |