Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
b2b12a63
Commit
b2b12a63
authored
Jun 27, 2014
by
Milo Yip
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #26 from pah/fixes/errorreturn-castqual
Fix segfault and build error on Linux
parents
fbf29dfc
0277ebdc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
document.h
include/rapidjson/document.h
+1
-1
reader.h
include/rapidjson/reader.h
+8
-0
No files found.
include/rapidjson/document.h
View file @
b2b12a63
...
...
@@ -202,7 +202,7 @@ public:
*/
template
<
typename
SourceAllocator
>
GenericValue
&
CopyFrom
(
const
GenericValue
<
Encoding
,
SourceAllocator
>&
rhs
,
Allocator
&
allocator
)
{
RAPIDJSON_ASSERT
((
void
*
)
this
!=
(
void
*
)
&
rhs
);
RAPIDJSON_ASSERT
((
void
*
)
this
!=
(
void
const
*
)
&
rhs
);
this
->~
GenericValue
();
new
(
this
)
GenericValue
(
rhs
,
allocator
);
return
*
this
;
...
...
include/rapidjson/reader.h
View file @
b2b12a63
...
...
@@ -243,12 +243,16 @@ public:
case
'['
:
ParseArray
<
parseFlags
>
(
is
,
handler
);
break
;
default
:
RAPIDJSON_PARSE_ERROR_NORETURN
(
"Expect either an object or array at root"
,
is
.
Tell
());
}
if
(
HasParseError
())
goto
out
;
SkipWhitespace
(
is
);
if
(
is
.
Peek
()
!=
'\0'
)
RAPIDJSON_PARSE_ERROR_NORETURN
(
"Nothing should follow the root object or array."
,
is
.
Tell
());
}
out
:
stack_
.
Clear
();
return
!
HasParseError
();
}
...
...
@@ -414,6 +418,8 @@ private:
if
(
parseFlags
&
kParseInsituFlag
)
{
Ch
*
head
=
s
.
PutBegin
();
ParseStringToStream
<
parseFlags
,
SourceEncoding
,
SourceEncoding
>
(
s
,
s
);
if
(
HasParseError
())
return
;
size_t
length
=
s
.
PutEnd
(
head
)
-
1
;
RAPIDJSON_ASSERT
(
length
<=
0xFFFFFFFF
);
handler
.
String
((
typename
TargetEncoding
::
Ch
*
)
head
,
SizeType
(
length
),
false
);
...
...
@@ -421,6 +427,8 @@ private:
else
{
StackStream
stackStream
(
stack_
);
ParseStringToStream
<
parseFlags
,
SourceEncoding
,
TargetEncoding
>
(
s
,
stackStream
);
if
(
HasParseError
())
return
;
handler
.
String
(
stack_
.
template
Pop
<
typename
TargetEncoding
::
Ch
>
(
stackStream
.
length_
),
stackStream
.
length_
-
1
,
true
);
}
is
=
s
;
// Restore is
...
...
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