Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12743)

Issue 6351051: Handled the case where int and float are of correct format, but large. The GLSL spec is not very cl… (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 10 months ago by Alok Priyadarshi
Modified:
11 years, 10 months ago
Reviewers:
kbr1
CC:
angleproject-review_googlegroups.com
Base URL:
http://angleproject.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Handled the case where int and float are of correct format, but large. The GLSL spec is not very clear on how integers should be interpreted for expressions. C99 says the expression is of type intmax_t. I am parsing all integers as int except those in expressions, which are being parsed as unsigned int. Committed: https://code.google.com/p/angleproject/source/detail?r=1179

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+192 lines, -21 lines) Patch
M src/compiler/preprocessor/new/Diagnostics.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/compiler/preprocessor/new/Diagnostics.cpp View 1 1 chunk +6 lines, -0 lines 0 comments Download
M src/compiler/preprocessor/new/DirectiveParser.cpp View 1 4 chunks +19 lines, -4 lines 0 comments Download
M src/compiler/preprocessor/new/ExpressionParser.cpp View 1 6 chunks +14 lines, -9 lines 0 comments Download
M src/compiler/preprocessor/new/ExpressionParser.y View 1 5 chunks +11 lines, -6 lines 0 comments Download
M src/compiler/preprocessor/new/Preprocessor.cpp View 1 1 chunk +42 lines, -0 lines 0 comments Download
M src/compiler/preprocessor/new/Token.h View 1 1 chunk +6 lines, -0 lines 0 comments Download
M src/compiler/preprocessor/new/Token.cpp View 1 2 chunks +44 lines, -0 lines 0 comments Download
M tests/preprocessor_tests/if_test.cpp View 1 1 chunk +42 lines, -0 lines 0 comments Download
M tests/preprocessor_tests/location_test.cpp View 1 1 chunk +3 lines, -1 line 0 comments Download
M tests/preprocessor_tests/version_test.cpp View 1 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 4
Alok Priyadarshi
11 years, 10 months ago (2012-06-29 00:16:57 UTC) #1
kbr1
LGTM with a few more tests added. http://codereview.appspot.com/6351051/diff/1/tests/preprocessor_tests/if_test.cpp File tests/preprocessor_tests/if_test.cpp (right): http://codereview.appspot.com/6351051/diff/1/tests/preprocessor_tests/if_test.cpp#newcode651 tests/preprocessor_tests/if_test.cpp:651: TEST_F(IfTest, IntegerOverflow) ...
11 years, 10 months ago (2012-06-29 17:59:26 UTC) #2
Alok Priyadarshi
http://codereview.appspot.com/6351051/diff/1/src/compiler/preprocessor/new/Preprocessor.cpp File src/compiler/preprocessor/new/Preprocessor.cpp (right): http://codereview.appspot.com/6351051/diff/1/src/compiler/preprocessor/new/Preprocessor.cpp#newcode98 src/compiler/preprocessor/new/Preprocessor.cpp:98: case Token::CONST_INT: I do not think overflow check belongs ...
11 years, 10 months ago (2012-06-29 19:33:05 UTC) #3
kbr1
11 years, 10 months ago (2012-06-30 01:28:25 UTC) #4
http://codereview.appspot.com/6351051/diff/1/src/compiler/preprocessor/new/Pr...
File src/compiler/preprocessor/new/Preprocessor.cpp (right):

http://codereview.appspot.com/6351051/diff/1/src/compiler/preprocessor/new/Pr...
src/compiler/preprocessor/new/Preprocessor.cpp:98: case Token::CONST_INT:
On 2012/06/29 19:33:06, Alok Priyadarshi wrote:
> I do not think overflow check belongs here. It should be done at the compiler
> level. The reason I added it here is because the old preprocessor performs
this
> check. I feel the same way about the check for identifier length. The old
> preprocessor complains if it is > 256.
> 
> These checks should be performed by the glue code between the preprocessor and
> compiler, which is glslang.l. I will move these checks there as soon as we get
> rid of the old preprocessor. That is the reason why I did not add tests for 
> integer/float overflows in the shader body.

I see. I didn't understand this before. Your plan sounds fine. LGTM then modulo
the addition of the other tests I mentioned.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b