Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
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
lvzhengyang
yaml-cpp
Commits
907be066
Commit
907be066
authored
Sep 24, 2008
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed infinite loop bug having to do with simple keys when we hit an unexpected EOF.
parent
3ed09b89
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
src/scanner.h
+1
-1
src/simplekey.cpp
+9
-3
yaml-reader/tests/test.yaml
+2
-3
No files found.
src/scanner.h
View file @
907be066
...
...
@@ -33,7 +33,7 @@ namespace YAML
// checking input
void
InsertSimpleKey
();
bool
VerifySimpleKey
();
bool
VerifySimpleKey
(
bool
force
=
false
);
void
VerifyAllSimpleKeys
();
bool
IsWhitespaceToBeEaten
(
char
ch
);
...
...
src/simplekey.cpp
View file @
907be066
...
...
@@ -50,7 +50,8 @@ namespace YAML
// VerifySimpleKey
// . Determines whether the latest simple key to be added is valid,
// and if so, makes it valid.
bool
Scanner
::
VerifySimpleKey
()
// . If 'force' is true, then we'll pop no matter what (whether we can verify it or not).
bool
Scanner
::
VerifySimpleKey
(
bool
force
)
{
m_isLastKeyValid
=
false
;
if
(
m_simpleKeys
.
empty
())
...
...
@@ -60,8 +61,11 @@ namespace YAML
SimpleKey
key
=
m_simpleKeys
.
top
();
// only validate if we're in the correct flow level
if
(
key
.
flowLevel
!=
m_flowLevel
)
if
(
key
.
flowLevel
!=
m_flowLevel
)
{
if
(
force
)
m_simpleKeys
.
pop
();
return
false
;
}
m_simpleKeys
.
pop
();
...
...
@@ -94,9 +98,11 @@ namespace YAML
return
isValid
;
}
// VerifyAllSimplyKeys
// . Pops all simple keys (with checking, but if we can't verify one, then pop it anyways).
void
Scanner
::
VerifyAllSimpleKeys
()
{
while
(
!
m_simpleKeys
.
empty
())
VerifySimpleKey
();
VerifySimpleKey
(
true
);
}
}
yaml-reader/tests/test.yaml
View file @
907be066
-
it's just
-
one thing
-
after another
bad YAML
:
[
\ No newline at end of file
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