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
97cb85c7
Commit
97cb85c7
authored
Apr 04, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PP: Fix #783: Catch end-of-argument expansion in token pasting.
parent
82460b5e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
4 deletions
+15
-4
tokenPaste.vert.out
Test/baseResults/tokenPaste.vert.out
+2
-1
tokenPaste.vert
Test/tokenPaste.vert
+5
-2
revision.h
glslang/Include/revision.h
+1
-1
PpScanner.cpp
glslang/MachineIndependent/preprocessor/PpScanner.cpp
+7
-0
No files found.
Test/baseResults/tokenPaste.vert.out
View file @
97cb85c7
...
@@ -8,7 +8,8 @@ ERROR: 0:69: '##' : combined token is invalid
...
@@ -8,7 +8,8 @@ ERROR: 0:69: '##' : combined token is invalid
ERROR: 0:82: 'macro expansion' : Too few args in Macro rec
ERROR: 0:82: 'macro expansion' : Too few args in Macro rec
ERROR: 0:82: '##' : unexpected location
ERROR: 0:82: '##' : unexpected location
ERROR: 0:82: '##' : unexpected location
ERROR: 0:82: '##' : unexpected location
ERROR: 8 compilation errors. No code generated.
ERROR: 0:86: '##' : unexpected location; end of argument
ERROR: 9 compilation errors. No code generated.
Shader version: 450
Shader version: 450
...
...
Test/tokenPaste.vert
View file @
97cb85c7
...
@@ -79,4 +79,8 @@ uniform M_OUTER(argPaste);
...
@@ -79,4 +79,8 @@ uniform M_OUTER(argPaste);
uniform
M_OUTER2
(
argPaste
);
uniform
M_OUTER2
(
argPaste
);
#define rec(x)##
#define rec(x)##
rec
(
rec
())
rec
(
rec
())
\ No newline at end of file
#define bax(bay)
#define baz bax(/##)
baz
glslang/Include/revision.h
View file @
97cb85c7
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.197
1
"
#define GLSLANG_REVISION "Overload400-PrecQual.197
4
"
#define GLSLANG_DATE "04-Apr-2017"
#define GLSLANG_DATE "04-Apr-2017"
glslang/MachineIndependent/preprocessor/PpScanner.cpp
View file @
97cb85c7
...
@@ -799,6 +799,7 @@ int TPpContext::tokenPaste(int token, TPpToken& ppToken)
...
@@ -799,6 +799,7 @@ int TPpContext::tokenPaste(int token, TPpToken& ppToken)
token
=
scanToken
(
&
pastedPpToken
);
token
=
scanToken
(
&
pastedPpToken
);
assert
(
token
==
PpAtomPaste
);
assert
(
token
==
PpAtomPaste
);
// This covers end of macro expansion
if
(
endOfReplacementList
())
{
if
(
endOfReplacementList
())
{
parseContext
.
ppError
(
ppToken
.
loc
,
"unexpected location; end of replacement list"
,
"##"
,
""
);
parseContext
.
ppError
(
ppToken
.
loc
,
"unexpected location; end of replacement list"
,
"##"
,
""
);
break
;
break
;
...
@@ -807,6 +808,12 @@ int TPpContext::tokenPaste(int token, TPpToken& ppToken)
...
@@ -807,6 +808,12 @@ int TPpContext::tokenPaste(int token, TPpToken& ppToken)
// get the token after the ##
// get the token after the ##
token
=
scanToken
(
&
pastedPpToken
);
token
=
scanToken
(
&
pastedPpToken
);
// This covers end of argument expansion
if
(
token
==
tMarkerInput
::
marker
)
{
parseContext
.
ppError
(
ppToken
.
loc
,
"unexpected location; end of argument"
,
"##"
,
""
);
break
;
}
// get the token text
// get the token text
switch
(
resultToken
)
{
switch
(
resultToken
)
{
case
PpAtomIdentifier
:
case
PpAtomIdentifier
:
...
...
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