ValhallaTeam / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Preprocessor Errors on Valid Integer Constants #186

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run $ echo "#if 2147483647 - 2147483646 == 1
#error subtraction of large numbers works
#endif" > large_number.cpp
2. run $ essl_to_glsl large_number.cpp
3. run $ g++ -E large_number.cpp

What is the expected output? What do you see instead?
The expected output is a preprocessor error with the message "subtraction of 
large numbers works"
The observed output is two wrong "INTEGER CONSTANT OVERFLOW" messages.

What version of the product are you using? On what operating system?
r705

Please provide any additional information below.
The problem is in scanner.c of the preprocessor on line 385/386:
http://www.google.com/codesearch#yFOqulIej54/trunk/src/compiler/preprocessor/sca
nner.c&q=INTEGER%20CONSTANT%20OVERFLOW%20package:http://angleproject%5C.googleco
de%5C.com&l=386

The mutation of ival on line 385 should be moved after the condition.

Original issue reported on code.google.com by kosmo...@gmail.com on 19 Jul 2011 at 10:20

GoogleCodeExporter commented 9 years ago
Introduced in r469

Original comment by kosmo...@gmail.com on 19 Jul 2011 at 10:50

GoogleCodeExporter commented 9 years ago

Original comment by kbr@chromium.org on 19 Jul 2011 at 10:53

GoogleCodeExporter commented 9 years ago
The old preprocessor has been replaced with a completely rewritten one.  This 
issue should no longer be a problem. 

Original comment by dan...@transgaming.com on 26 Oct 2012 at 7:35