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
a417f010
Commit
a417f010
authored
Jul 15, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17 from google/non-existing-string
Protect location setting methods from writing to non-existing strings.
parents
9e55f633
6c9a3816
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Scan.h
glslang/MachineIndependent/Scan.h
+4
-2
No files found.
glslang/MachineIndependent/Scan.h
View file @
a417f010
...
...
@@ -123,10 +123,12 @@ public:
}
// for #line override
void
setLine
(
int
newLine
)
{
loc
[
currentSource
].
line
=
newLine
;
}
void
setString
(
int
newString
)
{
loc
[
currentSource
].
string
=
newString
;
}
void
setLine
(
int
newLine
)
{
loc
[
getLastValidSourceIndex
()
].
line
=
newLine
;
}
void
setString
(
int
newString
)
{
loc
[
getLastValidSourceIndex
()
].
string
=
newString
;
}
const
TSourceLoc
&
getSourceLoc
()
const
{
return
loc
[
std
::
max
(
0
,
std
::
min
(
currentSource
,
numSources
-
finale
-
1
))];
}
// Returns the index (starting from 0) of the most recent valid source string we are reading from.
int
getLastValidSourceIndex
()
const
{
return
std
::
min
(
currentSource
,
numSources
-
1
);
}
void
consumeWhiteSpace
(
bool
&
foundNonSpaceTab
);
bool
consumeComment
();
...
...
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