Opened 6 years ago

Closed 6 years ago

#12221 closed Bugs (fixed)

coroutine<>::push_type function starts without pushing

Reported by: valentin.milea@… Owned by: olli
Milestone: To Be Determined Component: coroutine
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

According to coroutine2 docs: "In contrast to coroutine<>::pull_type, instantiating an coroutine<>::push_type does not pass the control of execution to coroutine-function - instead the first call of coroutine<>::push_type::operator() synthesizes a complementary coroutine<>::pull_type and passes it as reference to coroutine-function. "

So the function of a push-coroutine should never be entered unless at least one value is pushed. But the coroutine always tries to unwind in destructor and mistakenly resumes the function. Example attached.

This bug is present in coroutine2. Original coroutine library is unaffected.

Attachments (1)

coro2_unwind_bug.cpp (433 bytes ) - added by valentin.milea@… 6 years ago.

Download all attachments as: .zip

Change History (3)

by valentin.milea@…, 6 years ago

Attachment: coro2_unwind_bug.cpp added

comment:1 by olli, 6 years ago

thx, fixed

comment:2 by olli, 6 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.