Drop the float literal suffix

In GLSL ES 3.00, float literals are allowed to have an 'f' or 'F'
suffix, but they don't change the parsing process since they're always
interpreted as single-precision IEEE-754 floating-point values.

The std::istringstream used for parsing the literal's string can have
implementation dependent behavior depending on the presence of the
suffix, so this change removes it. This matches what ANGLE does.

Fixes: b/168250854
Change-Id: I203833a2e817ca698894db5669941fb435b97868
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48388
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
diff --git a/src/OpenGL/compiler/glslang.l b/src/OpenGL/compiler/glslang.l
index fdc3977..846afb5 100644
--- a/src/OpenGL/compiler/glslang.l
+++ b/src/OpenGL/compiler/glslang.l
@@ -509,7 +509,9 @@
         return 0;
     }
 
-    if (!atof_clamp(yytext, &(yylval->lex.f)))
+    std::string text = yytext;
+    text.resize(text.size() - 1);  // Drop the suffix
+    if(!atof_clamp(text.c_str(), &(yylval->lex.f)))
         yyextra->warning(*yylloc, "Float overflow", yytext, "");
 
     return(FLOATCONSTANT);
diff --git a/src/OpenGL/compiler/glslang_lex.cpp b/src/OpenGL/compiler/glslang_lex.cpp
index 0cf1555..82365ac 100644
--- a/src/OpenGL/compiler/glslang_lex.cpp
+++ b/src/OpenGL/compiler/glslang_lex.cpp
@@ -3741,7 +3741,9 @@
         return 0;
     }
 
-    if (!atof_clamp(yytext, &(yylval->lex.f)))
+    std::string text = yytext;
+    text.resize(text.size() - 1);  // Drop the suffix
+    if(!atof_clamp(text.c_str(), &(yylval->lex.f)))
         yyextra->warning(*yylloc, "Float overflow", yytext, "");
 
     return(FLOATCONSTANT);