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
faa720f1
Commit
faa720f1
authored
Jan 02, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PP: Fix issue #426, recover from bad-source macro expansion.
parent
bc5196c0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
4 deletions
+36
-4
cppBad2.vert.out
Test/baseResults/cppBad2.vert.out
+19
-0
cppBad2.vert
Test/cppBad2.vert
+4
-0
revision.h
glslang/Include/revision.h
+1
-1
Pp.cpp
glslang/MachineIndependent/preprocessor/Pp.cpp
+11
-3
AST.FromFile.cpp
gtests/AST.FromFile.cpp
+1
-0
No files found.
Test/baseResults/cppBad2.vert.out
0 → 100755
View file @
faa720f1
cppBad2.vert
ERROR: 0:3: 'macro expansion' : End of input in macro b
ERROR: 0:3: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
Shader version: 100
ERROR: node is still EOpNull!
0:? Linker Objects
Linked vertex stage:
ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point
Shader version: 100
ERROR: node is still EOpNull!
0:? Linker Objects
Test/cppBad2.vert
0 → 100755
View file @
faa720f1
#define a b(
#define b(x)
b
(
a
)
\ No newline at end of file
glslang/Include/revision.h
View file @
faa720f1
...
@@ -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.172
7
"
#define GLSLANG_REVISION "Overload400-PrecQual.172
8
"
#define GLSLANG_DATE "02-Jan-2017"
#define GLSLANG_DATE "02-Jan-2017"
glslang/MachineIndependent/preprocessor/Pp.cpp
View file @
faa720f1
...
@@ -934,12 +934,20 @@ TPpContext::TokenStream* TPpContext::PrescanMacroArg(TokenStream& arg, TPpToken*
...
@@ -934,12 +934,20 @@ TPpContext::TokenStream* TPpContext::PrescanMacroArg(TokenStream& arg, TPpToken*
TokenStream
*
expandedArg
=
new
TokenStream
;
TokenStream
*
expandedArg
=
new
TokenStream
;
pushInput
(
new
tMarkerInput
(
this
));
pushInput
(
new
tMarkerInput
(
this
));
pushTokenStreamInput
(
arg
);
pushTokenStreamInput
(
arg
);
while
((
token
=
scanToken
(
ppToken
))
!=
tMarkerInput
::
marker
)
{
while
((
token
=
scanToken
(
ppToken
))
!=
tMarkerInput
::
marker
&&
token
!=
EndOfInput
)
{
if
(
token
==
PpAtomIdentifier
&&
MacroExpand
(
ppToken
,
false
,
newLineOkay
)
!=
0
)
if
(
token
==
PpAtomIdentifier
&&
MacroExpand
(
ppToken
,
false
,
newLineOkay
)
!=
0
)
continue
;
continue
;
RecordToken
(
*
expandedArg
,
token
,
ppToken
);
RecordToken
(
*
expandedArg
,
token
,
ppToken
);
}
}
popInput
();
if
(
token
==
EndOfInput
)
{
// MacroExpand ate the marker, so had bad input, recover
delete
expandedArg
;
expandedArg
=
nullptr
;
}
else
{
// remove the marker
popInput
();
}
return
expandedArg
;
return
expandedArg
;
}
}
...
@@ -1133,7 +1141,7 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka
...
@@ -1133,7 +1141,7 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka
depth
=
0
;
depth
=
0
;
while
(
1
)
{
while
(
1
)
{
token
=
scanToken
(
ppToken
);
token
=
scanToken
(
ppToken
);
if
(
token
==
EndOfInput
)
{
if
(
token
==
EndOfInput
||
token
==
tMarkerInput
::
marker
)
{
parseContext
.
ppError
(
loc
,
"End of input in macro"
,
"macro expansion"
,
atomStrings
.
getString
(
macroAtom
));
parseContext
.
ppError
(
loc
,
"End of input in macro"
,
"macro expansion"
,
atomStrings
.
getString
(
macroAtom
));
delete
in
;
delete
in
;
return
0
;
return
0
;
...
...
gtests/AST.FromFile.cpp
View file @
faa720f1
...
@@ -79,6 +79,7 @@ INSTANTIATE_TEST_CASE_P(
...
@@ -79,6 +79,7 @@ INSTANTIATE_TEST_CASE_P(
"cppIndent.vert"
,
"cppIndent.vert"
,
"cppNest.vert"
,
"cppNest.vert"
,
"cppBad.vert"
,
"cppBad.vert"
,
"cppBad2.vert"
,
"cppComplexExpr.vert"
,
"cppComplexExpr.vert"
,
"badChars.frag"
,
"badChars.frag"
,
"pointCoord.frag"
,
"pointCoord.frag"
,
...
...
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