Skip to content

Bug with encoding multi-field with condition. #20

Open
@AngryJew911

Description

@AngryJew911

while (typename IE::condition{}(to));

Case:

struct MySeq : med::sequence<
    M<Flag>,
    O<Case1, Flag::is_case1>, // is_case1 returns true if Flag.get() == 1
    O<Case2, Flag::is_case2, med::inf>// is_case1 returns true if Flag.get() == 2
>
struct Msg : med::sequence<
    M<L, MySeq>
>
{
};

Decoder will try to decode Case2 until the end of Msg, but not end of MySeq with specified length. Probably, it happens because the loop

while (typename IE::condition{}(to));

doesn't check decoder(CHECK_STATE{}, ie) and IE::condition{}(to) return constant value for specific Msg. So loop ends only when decoding one more Case2 fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions