Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
663cbcdc
Commit
663cbcdc
authored
Mar 09, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #194 from google/if-macro
Preprocessor: Fix array out of bounds bug in processing if-else-endif macros.
parents
f7497e28
24e4bc99
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
3 deletions
+27
-3
preprocessor.many.endif.vert.err
Test/baseResults/preprocessor.many.endif.vert.err
+12
-0
preprocessor.many.endif.vert.out
Test/baseResults/preprocessor.many.endif.vert.out
+0
-0
preprocessor.many.endif.vert
Test/preprocessor.many.endif.vert
+10
-0
test-preprocessor-list
Test/test-preprocessor-list
+1
-0
Pp.cpp
glslang/MachineIndependent/preprocessor/Pp.cpp
+4
-3
No files found.
Test/baseResults/preprocessor.many.endif.vert.err
0 → 100644
View file @
663cbcdc
ERROR: 0:1: '#endif' : mismatched statements
ERROR: 0:2: '#endif' : mismatched statements
ERROR: 0:3: '#endif' : mismatched statements
ERROR: 0:4: '#endif' : mismatched statements
ERROR: 0:5: '#endif' : mismatched statements
ERROR: 0:6: '#endif' : mismatched statements
ERROR: 0:7: '#endif' : mismatched statements
ERROR: 0:10: 'preprocessor evaluation' : bad expression
ERROR: 0:11: '' : missing #endif
ERROR: 9 compilation errors. No code generated.
Test/baseResults/preprocessor.many.endif.vert.out
0 → 100644
View file @
663cbcdc
Test/preprocessor.many.endif.vert
0 → 100644
View file @
663cbcdc
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#if
#else
Test/test-preprocessor-list
View file @
663cbcdc
...
...
@@ -12,3 +12,4 @@ preprocessor.pragma.vert
preprocessor.simple.vert
preprocessor.success_if_parse_would_fail.vert
preprocessor.defined.vert
preprocessor.many.endif.vert
glslang/MachineIndependent/preprocessor/Pp.cpp
View file @
663cbcdc
...
...
@@ -867,12 +867,13 @@ int TPpContext::readCPPline(TPpToken* ppToken)
token
=
CPPelse
(
0
,
ppToken
);
break
;
case
PpAtomEndif
:
elseSeen
[
elsetracker
]
=
false
;
--
elsetracker
;
if
(
!
ifdepth
)
parseContext
.
ppError
(
ppToken
->
loc
,
"mismatched statements"
,
"#endif"
,
""
);
else
else
{
elseSeen
[
elsetracker
]
=
false
;
--
elsetracker
;
--
ifdepth
;
}
token
=
extraTokenCheck
(
PpAtomEndif
,
ppToken
,
scanToken
(
ppToken
));
break
;
case
PpAtomIf
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment