Scanning: 1) rationalize end-of-input everywhere, 2) prevent infinite loop at end...
authorJohn Kessenich <cepheus@frii.com>
Mon, 27 Jul 2015 15:37:55 +0000 (09:37 -0600)
committerJohn Kessenich <cepheus@frii.com>
Mon, 27 Jul 2015 15:37:55 +0000 (09:37 -0600)
commitc777fc2c4c14991af0d98c094f532405364701f2
tree0b9c221e1e42bda2c15bbf31115190dbf33df849
parent91b977e17217eea47c2bd0568e52df9db0c3c29d
Scanning: 1) rationalize end-of-input everywhere, 2) prevent infinite loop at end-of-input, 3) use positive chars.

Fixes issue #25. (char 255 aliased to -1 and missing tests for end of input).

1) All layers of input scanning now share a single EndOfInput value.
This avoids translation of it across layers of encapsulation.

2) Some places looking for end of line were not stopping on EndOfInput.

3) Use of "char" for the input made char values > 127 be negative numbers.
This allowed for aliasing of 255 to -1, etc.  This is fixed by using
unsigned char.
15 files changed:
Test/badChars.frag [new file with mode: 0644]
Test/baseResults/badChars.frag.out [new file with mode: 0644]
Test/baseResults/cppComplexExpr.vert.out
Test/baseResults/cppNest.vert.out
Test/baseResults/lineContinuation.vert.out
Test/testlist
glslang/MachineIndependent/ParseHelper.cpp
glslang/MachineIndependent/Scan.cpp
glslang/MachineIndependent/Scan.h
glslang/MachineIndependent/ShaderLang.cpp
glslang/MachineIndependent/preprocessor/Pp.cpp
glslang/MachineIndependent/preprocessor/PpAtom.cpp
glslang/MachineIndependent/preprocessor/PpContext.h
glslang/MachineIndependent/preprocessor/PpScanner.cpp
glslang/MachineIndependent/preprocessor/PpTokens.cpp