Skip to content

c2rust-ast-exporter: fix segfault from iterator invalidation#897

Merged
kkysen merged 1 commit intoimmunant:masterfrom
maribu:c2rust-ast-export/fix_segfault
Apr 24, 2023
Merged

c2rust-ast-exporter: fix segfault from iterator invalidation#897
kkysen merged 1 commit intoimmunant:masterfrom
maribu:c2rust-ast-export/fix_segfault

Conversation

@maribu
Copy link
Copy Markdown

@maribu maribu commented Apr 24, 2023

Using an iterator to iterate over an vector while modifying the underlying vector is invalid. This caused an segfault for a specific input, which is fixed by using operator[] for accessing the vector members instead.

Using an iterator to iterate over an vector while modifying the
underlying vector is invalid. This caused an segfault for a specific
input, which is fixed by using operator[] for accessing the vector
members instead.
Copy link
Copy Markdown
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for hunting this down! Looks like it was a difficult bug in RIOT-OS/RIOT#19495, though at least the fix is quite simple.

@kkysen kkysen changed the title c2rust-ast-exporter: fix segfault c2rust-ast-exporter: fix segfault from iterator invalidation Apr 24, 2023
@kkysen kkysen merged commit 52ccd2a into immunant:master Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants