Skip to content

Conversation

@oyvindronningstad
Copy link
Collaborator

@oyvindronningstad oyvindronningstad commented Jun 6, 2025

together with the zcbor state.

src: Use elem_state backup in relevant functions

I.e. in unions and repetitions. In both cases, it's ok to fail decoding
something because it's optional, and if the union element or repeated data
being decoded includes multiple map elements, backups are needed in case
flags have been set for some map elements, then fails later. In that case,
the previous map elements' flags must be undone, and a backup is the way
to keep the old state so it can be restored.

@oyvindronningstad oyvindronningstad changed the title Backup elem state zcbor_common: Add support for backing up elem_state Jun 11, 2025
@oyvindronningstad oyvindronningstad force-pushed the backup-elem_state branch 5 times, most recently from 40404d5 to 1f405ae Compare July 17, 2025 13:47
@oyvindronningstad oyvindronningstad force-pushed the backup-elem_state branch 2 times, most recently from 07ba35a to 5dec230 Compare August 7, 2025 12:52
@oyvindronningstad oyvindronningstad force-pushed the backup-elem_state branch 4 times, most recently from 2b0a465 to 4786c7a Compare August 22, 2025 15:01
@oyvindronningstad oyvindronningstad force-pushed the backup-elem_state branch 3 times, most recently from f4d94ac to 3070b7e Compare September 25, 2025 13:01
@oyvindronningstad oyvindronningstad force-pushed the backup-elem_state branch 2 times, most recently from b8a619e to 03c5ab2 Compare December 19, 2025 09:03
Implement strict_load().

Signed-off-by: Øyvind Rønningstad <[email protected]>
Signed-off-by: Øyvind Rønningstad <[email protected]>
together with the zcbor state.

Signed-off-by: Øyvind Rønningstad <[email protected]>
I.e. in unions and repetitions. In both cases, it's ok to fail decoding
something because it's optional, and if the union element or repeated data
being decoded includes multiple map elements, backups are needed in case
flags have been set for some map elements, then fails later. In that case,
the previous map elements' flags must be undone, and a backup is the way
to keep the old state so it can be restored.

Signed-off-by: Øyvind Rønningstad <[email protected]>
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.

1 participant