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
31a51bec
Commit
31a51bec
authored
Jul 19, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue #391: input stack underflow on too few macro arguments.
parent
f8332509
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
4 deletions
+23
-4
badMacroArgs.frag
Test/badMacroArgs.frag
+5
-0
badMacroArgs.frag.out
Test/baseResults/badMacroArgs.frag.out
+7
-0
cppIndent.vert
Test/cppIndent.vert
+1
-1
runtests
Test/runtests
+7
-0
PpContext.h
glslang/MachineIndependent/preprocessor/PpContext.h
+2
-2
PpTokens.cpp
glslang/MachineIndependent/preprocessor/PpTokens.cpp
+1
-1
No files found.
Test/badMacroArgs.frag
0 → 100755
View file @
31a51bec
#version 400
#define m(a) a
m
()
\ No newline at end of file
Test/baseResults/badMacroArgs.frag.out
0 → 100644
View file @
31a51bec
badMacroArgs.frag
Warning, version 400 is not yet complete; most version-specific features are present, but some are missing.
ERROR: 0:4: 'macro expansion' : Too few args in Macro m
ERROR: 0:4: '' : syntax error
ERROR: 2 compilation errors. No code generated.
Test/cppIndent.vert
View file @
31a51bec
...
...
@@ -58,4 +58,4 @@ sum += 900000000.0;
#define FUNC(a,b) a+b
// needs to be last test in file due to syntax error
void
foo986
(){
FUNC
(
(((
2
)))),
4
);
}
// ERROR, too
many
)
void
foo986
(){
FUNC
(
(((
2
)))),
4
);
}
// ERROR, too
few arguments
)
Test/runtests
View file @
31a51bec
...
...
@@ -19,6 +19,13 @@ fi
rm
-f
comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
#
# special tests
#
$EXE
badMacroArgs.frag
>
$TARGETDIR
/badMacroArgs.frag.out
diff
-b
$BASEDIR
/badMacroArgs.frag.out
$TARGETDIR
/badMacroArgs.frag.out
||
HASERROR
=
1
#
# reflection tests
#
echo
Running reflection...
...
...
glslang/MachineIndependent/preprocessor/PpContext.h
View file @
31a51bec
...
...
@@ -218,7 +218,7 @@ protected:
TParseContextBase
&
parseContext
;
// Get the next token from *stack* of input sources, popping input sources
// that are out of tokens, down until an input source
s
is found that has a token.
// that are out of tokens, down until an input source is found that has a token.
// Return EndOfInput when there are no more tokens to be found by doing this.
int
scanToken
(
TPpToken
*
ppToken
)
{
...
...
@@ -226,7 +226,7 @@ protected:
while
(
!
inputStack
.
empty
())
{
token
=
inputStack
.
back
()
->
scan
(
ppToken
);
if
(
token
!=
EndOfInput
)
if
(
token
!=
EndOfInput
||
inputStack
.
empty
()
)
break
;
popInput
();
}
...
...
glslang/MachineIndependent/preprocessor/PpTokens.cpp
View file @
31a51bec
...
...
@@ -179,7 +179,7 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
if
(
ltoken
>
127
)
ltoken
+=
128
;
switch
(
ltoken
)
{
case
'#'
:
case
'#'
:
if
(
lReadByte
(
pTok
)
==
'#'
)
{
parseContext
.
requireProfile
(
ppToken
->
loc
,
~
EEsProfile
,
"token pasting (##)"
);
parseContext
.
profileRequires
(
ppToken
->
loc
,
~
EEsProfile
,
130
,
0
,
"token pasting (##)"
);
...
...
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