Mesa (master): glsl: Disallow float literals with the 'f' suffix but no point or exponent
Neil Roberts
nroberts at kemper.freedesktop.org
Thu Nov 27 11:48:09 UTC 2014
Module: Mesa
Branch: master
Commit: 9d8aa886938c7476a911f8cf8051d87d76755394
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d8aa886938c7476a911f8cf8051d87d76755394
Author: Neil Roberts <neil at linux.intel.com>
Date: Wed Nov 26 17:15:01 2014 +0000
glsl: Disallow float literals with the 'f' suffix but no point or exponent
According to the GLSL spec float literals like ‘1f’ shouldn't be allowed
without adding a decimal point or an exponent. Apparently the AMD driver also
disallows this so it seems unlikely that anything would be relying on it.
Reviewed-by: Matt Turner <mattst88 at gmail.com>
---
src/glsl/glsl_lexer.ll | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/glsl/glsl_lexer.ll b/src/glsl/glsl_lexer.ll
index ad6d32f..419a07b 100644
--- a/src/glsl/glsl_lexer.ll
+++ b/src/glsl/glsl_lexer.ll
@@ -466,10 +466,6 @@ layout {
yylval->real = _mesa_strtof(yytext, NULL);
return FLOATCONSTANT;
}
-[0-9]+[fF] {
- yylval->real = _mesa_strtof(yytext, NULL);
- return FLOATCONSTANT;
- }
true {
yylval->n = 1;
More information about the mesa-commit
mailing list