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
f05b2577
Unverified
Commit
f05b2577
authored
May 23, 2020
by
Raúl Gutiérrez Segalés
Committed by
GitHub
May 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crash when parsing `{x:` (#865)
parent
d9c35b60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
src/exp.h
+1
-1
test/integration/node_spec_test.cpp
+5
-0
No files found.
src/exp.h
View file @
f05b2577
...
@@ -155,7 +155,7 @@ inline const RegEx& PlainScalar() {
...
@@ -155,7 +155,7 @@ inline const RegEx& PlainScalar() {
inline
const
RegEx
&
PlainScalarInFlow
()
{
inline
const
RegEx
&
PlainScalarInFlow
()
{
static
const
RegEx
e
=
static
const
RegEx
e
=
!
(
BlankOrBreak
()
|
RegEx
(
"?,[]{}#&*!|>
\'\"
%@`"
,
REGEX_OR
)
|
!
(
BlankOrBreak
()
|
RegEx
(
"?,[]{}#&*!|>
\'\"
%@`"
,
REGEX_OR
)
|
(
RegEx
(
"-:"
,
REGEX_OR
)
+
Blank
(
)));
(
RegEx
(
"-:"
,
REGEX_OR
)
+
(
Blank
()
|
RegEx
()
)));
return
e
;
return
e
;
}
}
inline
const
RegEx
&
EndScalar
()
{
inline
const
RegEx
&
EndScalar
()
{
...
...
test/integration/node_spec_test.cpp
View file @
f05b2577
...
@@ -1127,5 +1127,10 @@ TEST(NodeSpecTest, Ex8_22_BlockCollectionNodes) {
...
@@ -1127,5 +1127,10 @@ TEST(NodeSpecTest, Ex8_22_BlockCollectionNodes) {
EXPECT_EQ
(
1
,
doc
[
"mapping"
].
size
());
EXPECT_EQ
(
1
,
doc
[
"mapping"
].
size
());
EXPECT_EQ
(
"bar"
,
doc
[
"mapping"
][
"foo"
].
as
<
std
::
string
>
());
EXPECT_EQ
(
"bar"
,
doc
[
"mapping"
][
"foo"
].
as
<
std
::
string
>
());
}
}
TEST
(
NodeSpecTest
,
FlowMapNotClosed
)
{
EXPECT_THROW_PARSER_EXCEPTION
(
Load
(
"{x:"
),
ErrorMsg
::
UNKNOWN_TOKEN
);
}
}
}
}
}
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