landelare / ue5coro

A C++20 coroutine implementation for Unreal Engine 5 that feels almost native.
BSD 3-Clause Clear License
543 stars 48 forks source link

Live coding breaks generators #14

Closed qwe321 closed 1 year ago

qwe321 commented 1 year ago

While some simple generators work for most of the time when rebuilding using live coding, there are cases in which generators are broken, i.e.

template <typename TItem>
class TWrappedMap
{
public:
    TMap<FString, TItem> Map;

    TGenerator<TPair<FString, TItem>> SomeGenerator()
    {
        for (const auto& Item : Map)
            co_yield TPair<FString, TItem>(Item);
    }

    TGenerator<TPair<FString, TItem>> OtherGenerator() { ... }
}

Rebuilding the code with live coding will result in crash where stacktrace looks like wrong method is getting called (i.e. SomeGenerator gets swapped with OtherGenerator, for SomeGenerator call stacktrace shows OtherGenerator$_ResumeCoro$1(...), crash further points to constructor of TConstSetBitIterator breaking at range check.

landelare commented 1 year ago

You might be seeing the effects of this bug: https://github.com/MolecularMatters/lpp_public/issues/3

landelare commented 1 year ago

Since this doesn't appear to be a bug with UE5Coro, I'm inclined to close this. If you think that there's something related in TGenerator that I can fix, please reopen this issue with additional information.