ERROR: 0:49: '' : bad digit in hexidecimal literal \r
ERROR: 0:50: '' : hexidecimal literal too big \r
ERROR: 0:88: '' : float literal needs a decimal point or exponent \r
-ERROR: 10 compilation errors. No code generated.\r
+ERROR: 0:98: '' : numeric literal too big \r
+ERROR: 0:101: '' : numeric literal too big \r
+ERROR: 12 compilation errors. No code generated.\r
\r
\r
Shader version: 400\r
0:88 'e5' (temp float)\r
0:88 Constant:\r
0:88 5.000000\r
+0:98 Sequence\r
+0:98 move second child to first child (temp uint)\r
+0:98 'g1' (global uint)\r
+0:98 Constant:\r
+0:98 4294967295 (const uint)\r
+0:99 Sequence\r
+0:99 move second child to first child (temp uint)\r
+0:99 'g2' (global uint)\r
+0:99 Constant:\r
+0:99 4294967295 (const uint)\r
+0:100 Sequence\r
+0:100 move second child to first child (temp uint)\r
+0:100 'g3' (global uint)\r
+0:100 Constant:\r
+0:100 4294967294 (const uint)\r
+0:101 Sequence\r
+0:101 move second child to first child (temp int)\r
+0:101 'g4' (global int)\r
+0:101 Constant:\r
+0:101 -1 (const int)\r
+0:102 Sequence\r
+0:102 move second child to first child (temp int)\r
+0:102 'g5' (global int)\r
+0:102 Constant:\r
+0:102 -1 (const int)\r
+0:103 Sequence\r
+0:103 move second child to first child (temp int)\r
+0:103 'g6' (global int)\r
+0:103 Constant:\r
+0:103 -2 (const int)\r
0:? Linker Objects\r
0:? 'c2' (layout(location=2 ) out 4-component vector of float)\r
0:? 'c3' (layout(location=3 ) out 4-component vector of float)\r
0:? 'c5' (layout(location=5 ) out 4-component vector of float)\r
0:? 'c6' (layout(location=6 ) out 4-component vector of float)\r
0:? 'c7' (layout(location=7 ) out 4-component vector of float)\r
+0:? 'g1' (global uint)\r
+0:? 'g2' (global uint)\r
+0:? 'g3' (global uint)\r
+0:? 'g4' (global int)\r
+0:? 'g5' (global int)\r
+0:? 'g6' (global int)\r
\r
\r
Linked fragment stage:\r
0:88 'e5' (temp float)\r
0:88 Constant:\r
0:88 5.000000\r
+0:98 Sequence\r
+0:98 move second child to first child (temp uint)\r
+0:98 'g1' (global uint)\r
+0:98 Constant:\r
+0:98 4294967295 (const uint)\r
+0:99 Sequence\r
+0:99 move second child to first child (temp uint)\r
+0:99 'g2' (global uint)\r
+0:99 Constant:\r
+0:99 4294967295 (const uint)\r
+0:100 Sequence\r
+0:100 move second child to first child (temp uint)\r
+0:100 'g3' (global uint)\r
+0:100 Constant:\r
+0:100 4294967294 (const uint)\r
+0:101 Sequence\r
+0:101 move second child to first child (temp int)\r
+0:101 'g4' (global int)\r
+0:101 Constant:\r
+0:101 -1 (const int)\r
+0:102 Sequence\r
+0:102 move second child to first child (temp int)\r
+0:102 'g5' (global int)\r
+0:102 Constant:\r
+0:102 -1 (const int)\r
+0:103 Sequence\r
+0:103 move second child to first child (temp int)\r
+0:103 'g6' (global int)\r
+0:103 Constant:\r
+0:103 -2 (const int)\r
0:? Linker Objects\r
0:? 'c2' (layout(location=2 ) out 4-component vector of float)\r
0:? 'c3' (layout(location=3 ) out 4-component vector of float)\r
0:? 'c5' (layout(location=5 ) out 4-component vector of float)\r
0:? 'c6' (layout(location=6 ) out 4-component vector of float)\r
0:? 'c7' (layout(location=7 ) out 4-component vector of float)\r
+0:? 'g1' (global uint)\r
+0:? 'g2' (global uint)\r
+0:? 'g3' (global uint)\r
+0:? 'g4' (global int)\r
+0:? 'g5' (global int)\r
+0:? 'g6' (global int)\r
\r
} else {
// Finish handling signed and unsigned integers
int numericLen = len;
- int uint = 0;
+ bool uint = false;
if (ch == 'u' || ch == 'U') {
if (len < TPpToken::maxTokenLength)
ppToken->name[len++] = (char)ch;
- uint = 1;
+ uint = true;
} else
pp->ungetChar();
- ppToken->name[len] = '\0';
+ ppToken->name[len] = '\0';
ival = 0;
- for (ii = 0; ii < numericLen; ii++) {
- ch = ppToken->name[ii] - '0';
- if ((ival > 0x19999999u) || (ival == 0x19999999u && ch >= 6)) {
+ const unsigned oneTenthMaxInt = 0xFFFFFFFFu / 10;
+ const unsigned remainderMaxInt = 0xFFFFFFFFu - 10 * oneTenthMaxInt;
+ for (int i = 0; i < numericLen; i++) {
+ ch = ppToken->name[i] - '0';
+ if ((ival > oneTenthMaxInt) || (ival == oneTenthMaxInt && ch > remainderMaxInt)) {
pp->parseContext.error(ppToken->loc, "numeric literal too big", "", "");
ival = 0xFFFFFFFFu;
break;