Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
1f4a6986
Commit
1f4a6986
authored
Nov 21, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect against self-assignment, close #1169
parent
f71e95d7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
+18
-12
libcaf_core/src/error.cpp
libcaf_core/src/error.cpp
+3
-1
libcaf_core/src/message.cpp
libcaf_core/src/message.cpp
+10
-8
libcaf_io/src/io/network/ip_endpoint.cpp
libcaf_io/src/io/network/ip_endpoint.cpp
+5
-3
No files found.
libcaf_core/src/error.cpp
View file @
1f4a6986
...
...
@@ -39,7 +39,9 @@ error::error(const error& x) : data_(x ? new data(*x.data_) : nullptr) {
}
error
&
error
::
operator
=
(
const
error
&
x
)
{
if
(
x
)
{
if
(
this
==
&
x
)
{
// nop
}
else
if
(
x
)
{
if
(
data_
==
nullptr
)
data_
.
reset
(
new
data
(
*
x
.
data_
));
else
...
...
libcaf_core/src/message.cpp
View file @
1f4a6986
...
...
@@ -131,6 +131,7 @@ bool load_data(Deserializer& source, message::data_ptr& data) {
swap
(
meta
,
other
.
meta
);
}
object_ptr
&
operator
=
(
object_ptr
&&
other
)
noexcept
{
if
(
this
!=
&
other
)
{
if
(
obj
)
{
meta
->
destroy
(
obj
);
free
(
obj
);
...
...
@@ -140,6 +141,7 @@ bool load_data(Deserializer& source, message::data_ptr& data) {
using
std
::
swap
;
swap
(
obj
,
other
.
obj
);
swap
(
meta
,
other
.
meta
);
}
return
*
this
;
}
~
object_ptr
()
noexcept
{
...
...
libcaf_io/src/io/network/ip_endpoint.cpp
View file @
1f4a6986
...
...
@@ -62,9 +62,11 @@ ip_endpoint::ip_endpoint(const ip_endpoint& other) {
}
ip_endpoint
&
ip_endpoint
::
operator
=
(
const
ip_endpoint
&
other
)
{
if
(
this
!=
&
other
)
{
ptr_
.
reset
(
new
ip_endpoint
::
impl
);
memcpy
(
address
(),
other
.
caddress
(),
sizeof
(
sockaddr_storage
));
*
length
()
=
*
other
.
clength
();
}
return
*
this
;
}
...
...
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