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
13444545
Commit
13444545
authored
Mar 09, 2020
by
Jeff Bolz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable escape sequences for #line and #error
parent
f333272e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
4 deletions
+10
-4
hlsl.pp.line4.frag.out
Test/baseResults/hlsl.pp.line4.frag.out
+2
-2
Pp.cpp
glslang/MachineIndependent/preprocessor/Pp.cpp
+4
-0
PpContext.cpp
glslang/MachineIndependent/preprocessor/PpContext.cpp
+2
-1
PpContext.h
glslang/MachineIndependent/preprocessor/PpContext.h
+1
-0
PpScanner.cpp
glslang/MachineIndependent/preprocessor/PpScanner.cpp
+1
-1
No files found.
Test/baseResults/hlsl.pp.line4.frag.out
View file @
13444545
...
@@ -9,8 +9,8 @@ hlsl.pp.line4.frag
...
@@ -9,8 +9,8 @@ hlsl.pp.line4.frag
EntryPoint Fragment 5 "MainPs" 70 74
EntryPoint Fragment 5 "MainPs" 70 74
ExecutionMode 5 OriginUpperLeft
ExecutionMode 5 OriginUpperLeft
1: String "hlsl.pp.line4.frag"
1: String "hlsl.pp.line4.frag"
17: String "C:\
Users\Greg\shaders\line
\foo4.frag"
17: String "C:\
\Users\\Greg\\shaders\\line\
\foo4.frag"
32: String "C:\
Users\Greg\shaders\line
\u1.h"
32: String "C:\
\Users\\Greg\\shaders\\line\
\u1.h"
Source HLSL 500 1 "// OpModuleProcessed auto-map-locations
Source HLSL 500 1 "// OpModuleProcessed auto-map-locations
// OpModuleProcessed auto-map-bindings
// OpModuleProcessed auto-map-bindings
// OpModuleProcessed entry-point MainPs
// OpModuleProcessed entry-point MainPs
...
...
glslang/MachineIndependent/preprocessor/Pp.cpp
View file @
13444545
...
@@ -722,7 +722,9 @@ int TPpContext::CPPline(TPpToken* ppToken)
...
@@ -722,7 +722,9 @@ int TPpContext::CPPline(TPpToken* ppToken)
const
char
*
sourceName
=
nullptr
;
// Optional source file name.
const
char
*
sourceName
=
nullptr
;
// Optional source file name.
bool
lineErr
=
false
;
bool
lineErr
=
false
;
bool
fileErr
=
false
;
bool
fileErr
=
false
;
disableEscapeSequences
=
true
;
token
=
eval
(
token
,
MIN_PRECEDENCE
,
false
,
lineRes
,
lineErr
,
ppToken
);
token
=
eval
(
token
,
MIN_PRECEDENCE
,
false
,
lineRes
,
lineErr
,
ppToken
);
disableEscapeSequences
=
false
;
if
(
!
lineErr
)
{
if
(
!
lineErr
)
{
lineToken
=
lineRes
;
lineToken
=
lineRes
;
if
(
token
==
'\n'
)
if
(
token
==
'\n'
)
...
@@ -765,7 +767,9 @@ int TPpContext::CPPline(TPpToken* ppToken)
...
@@ -765,7 +767,9 @@ int TPpContext::CPPline(TPpToken* ppToken)
// Handle #error
// Handle #error
int
TPpContext
::
CPPerror
(
TPpToken
*
ppToken
)
int
TPpContext
::
CPPerror
(
TPpToken
*
ppToken
)
{
{
disableEscapeSequences
=
true
;
int
token
=
scanToken
(
ppToken
);
int
token
=
scanToken
(
ppToken
);
disableEscapeSequences
=
false
;
std
::
string
message
;
std
::
string
message
;
TSourceLoc
loc
=
ppToken
->
loc
;
TSourceLoc
loc
=
ppToken
->
loc
;
...
...
glslang/MachineIndependent/preprocessor/PpContext.cpp
100755 → 100644
View file @
13444545
...
@@ -87,7 +87,8 @@ namespace glslang {
...
@@ -87,7 +87,8 @@ namespace glslang {
TPpContext
::
TPpContext
(
TParseContextBase
&
pc
,
const
std
::
string
&
rootFileName
,
TShader
::
Includer
&
inclr
)
:
TPpContext
::
TPpContext
(
TParseContextBase
&
pc
,
const
std
::
string
&
rootFileName
,
TShader
::
Includer
&
inclr
)
:
preamble
(
0
),
strings
(
0
),
previous_token
(
'\n'
),
parseContext
(
pc
),
includer
(
inclr
),
inComment
(
false
),
preamble
(
0
),
strings
(
0
),
previous_token
(
'\n'
),
parseContext
(
pc
),
includer
(
inclr
),
inComment
(
false
),
rootFileName
(
rootFileName
),
rootFileName
(
rootFileName
),
currentSourceFile
(
rootFileName
)
currentSourceFile
(
rootFileName
),
disableEscapeSequences
(
false
)
{
{
ifdepth
=
0
;
ifdepth
=
0
;
for
(
elsetracker
=
0
;
elsetracker
<
maxIfNesting
;
elsetracker
++
)
for
(
elsetracker
=
0
;
elsetracker
<
maxIfNesting
;
elsetracker
++
)
...
...
glslang/MachineIndependent/preprocessor/PpContext.h
View file @
13444545
...
@@ -695,6 +695,7 @@ protected:
...
@@ -695,6 +695,7 @@ protected:
std
::
string
currentSourceFile
;
std
::
string
currentSourceFile
;
std
::
istringstream
strtodStream
;
std
::
istringstream
strtodStream
;
bool
disableEscapeSequences
;
};
};
}
// end namespace glslang
}
// end namespace glslang
...
...
glslang/MachineIndependent/preprocessor/PpScanner.cpp
View file @
13444545
...
@@ -1030,7 +1030,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
...
@@ -1030,7 +1030,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
ch
=
getch
();
ch
=
getch
();
while
(
ch
!=
'"'
&&
ch
!=
'\n'
&&
ch
!=
EndOfInput
)
{
while
(
ch
!=
'"'
&&
ch
!=
'\n'
&&
ch
!=
EndOfInput
)
{
if
(
len
<
MaxTokenLength
)
{
if
(
len
<
MaxTokenLength
)
{
if
(
ch
==
'\\'
)
{
if
(
ch
==
'\\'
&&
!
pp
->
disableEscapeSequences
)
{
int
nextCh
=
getch
();
int
nextCh
=
getch
();
switch
(
nextCh
)
{
switch
(
nextCh
)
{
case
'\''
:
ch
=
0x27
;
break
;
case
'\''
:
ch
=
0x27
;
break
;
...
...
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