Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'variant' has undefined behavior for assignment operator of underlying value #2414

Open
elBoberido opened this issue Jan 17, 2025 · 0 comments · May be fixed by #2413
Open

'variant' has undefined behavior for assignment operator of underlying value #2414

elBoberido opened this issue Jan 17, 2025 · 0 comments · May be fixed by #2413
Labels
bug Something isn't working

Comments

@elBoberido
Copy link
Member

elBoberido commented Jan 17, 2025

Required information

Operating system:
any

Compiler version:
any

Eclipse iceoryx version:
all

Observed result or behaviour:

This leads to undefined behavior since the memory is not initialized with a Foo but the implementation calls the assignment operator of Foo with the uninitialized memory as left hand side.

variant<Foo> f;
f = Foo{};

Expected result or behaviour:

No undefined behavior.

Conditions where it occurred / Performed steps:

code review

@elBoberido elBoberido added the bug Something isn't working label Jan 17, 2025
yuanxingyang added a commit to yuanxingyang/iceoryx that referenced this issue Jan 17, 2025
yuanxingyang added a commit to yuanxingyang/iceoryx that referenced this issue Jan 18, 2025
yuanxingyang added a commit to yuanxingyang/iceoryx that referenced this issue Jan 19, 2025
yuanxingyang added a commit to yuanxingyang/iceoryx that referenced this issue Jan 19, 2025
yuanxingyang added a commit to yuanxingyang/iceoryx that referenced this issue Jan 19, 2025
yuanxingyang added a commit to yuanxingyang/iceoryx that referenced this issue Jan 25, 2025
yuanxingyang added a commit to yuanxingyang/iceoryx that referenced this issue Jan 26, 2025
yuanxingyang added a commit to yuanxingyang/iceoryx that referenced this issue Feb 19, 2025
@elBoberido elBoberido changed the title 'variant' type index is not reset after move 'variant' has undefined behavior for assignment operator of underlying value Feb 19, 2025
@elBoberido elBoberido added this to v3.0 Feb 19, 2025
@github-project-automation github-project-automation bot moved this to To do in v3.0 Feb 19, 2025
@mossmaurice mossmaurice moved this from To do to In progress in v3.0 Feb 19, 2025
yuanxingyang added a commit to yuanxingyang/iceoryx that referenced this issue Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In progress
1 participant