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
68aed3b2
Commit
68aed3b2
authored
Feb 13, 2023
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix UB when using prefix_and_tail
parent
b832c273
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
1 deletion
+11
-1
CHANGELOG.md
CHANGELOG.md
+2
-0
libcaf_core/caf/flow/op/from_steps.hpp
libcaf_core/caf/flow/op/from_steps.hpp
+3
-0
libcaf_core/caf/flow/op/prefix_and_tail.hpp
libcaf_core/caf/flow/op/prefix_and_tail.hpp
+1
-1
libcaf_core/caf/flow/op/ucast.hpp
libcaf_core/caf/flow/op/ucast.hpp
+5
-0
No files found.
CHANGELOG.md
View file @
68aed3b2
...
...
@@ -26,6 +26,8 @@ is based on [Keep a Changelog](https://keepachangelog.com).
respond with
`void`
(#1369).
-
Fix subscription and event handling in flow buffer operator.
-
Fix undefined behavior in getter functions of the flow
`mcast`
operator.
-
Add checks to avoid potential UB when using
`prefix_and_tail`
or other
operators that use the
`ucast`
operator internally.
## [0.19.0-rc.1] - 2022-10-31
...
...
libcaf_core/caf/flow/op/from_steps.hpp
View file @
68aed3b2
...
...
@@ -228,6 +228,9 @@ private:
buf_
.
pop_front
();
--
demand_
;
out_
.
on_next
(
item
);
// Note: on_next() may call dispose() and set out_ to nullptr.
if
(
!
out_
)
return
;
}
if
(
in_
)
{
pull
();
...
...
libcaf_core/caf/flow/op/prefix_and_tail.hpp
View file @
68aed3b2
...
...
@@ -121,7 +121,7 @@ public:
}
void
request
(
size_t
demand
)
override
{
// Only called by
the out_, never by the sink_. The latter triggers
// Only called by
out_, never by sink_ (triggers on_sink_demand_change()).
prefix_demand_
+=
demand
;
if
(
sub_
&&
!
requested_prefix_
)
{
sub_
.
request
(
prefix_size_
);
...
...
libcaf_core/caf/flow/op/ucast.hpp
View file @
68aed3b2
...
...
@@ -123,6 +123,9 @@ public:
auto
got_some
=
demand
>
0
&&
!
buf
.
empty
();
for
(
bool
run
=
got_some
;
run
;
run
=
demand
>
0
&&
!
buf
.
empty
())
{
out
.
on_next
(
buf
.
front
());
// Note: on_next may call dispose().
if
(
disposed
)
return
;
buf
.
pop_front
();
--
demand
;
}
...
...
@@ -166,6 +169,8 @@ public:
}
void
request
(
size_t
n
)
override
{
if
(
!
state_
)
return
;
state_
->
demand
+=
n
;
if
(
state_
->
when_demand_changed
)
state_
->
when_demand_changed
.
run
();
...
...
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