Kaynağa Gözat

Fix parsing hexadecimal (lowercase `e`,`f`) in shaders

Yuri Roubinsky 4 yıl önce
ebeveyn
işleme
19e0a1ec9d
1 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 4 4
      servers/rendering/shader_language.cpp

+ 4 - 4
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;