Skip to content

Validate Fw.LogSeverity against the dictionary like the other canonical types (#225) - #238

Open
zimri-leisher wants to merge 1 commit into
develfrom
225-validate-log-severity
Open

Validate Fw.LogSeverity against the dictionary like the other canonical types (#225)#238
zimri-leisher wants to merge 1 commit into
develfrom
225-validate-log-severity

Conversation

@zimri-leisher

Copy link
Copy Markdown
Collaborator

Fixes #225.

Every other canonical type the compiler bakes in (Fw.CmdResponse,
Fw.TimeComparison, Svc.BlockState, ...) goes through
_validate_and_replace_type, but LOG_SEVERITY was layered over the
dictionary's definition unchecked. A dictionary defining Fw.LogSeverity with
another representation type would have log() push a one-byte severity while
POP_EVENT pops Fw::LogSeverity::SerialType, silently misreading the stack.
It is registered required=False, like the validity enums, so a dictionary
without events still loads.

Red/green: the two new dictionaries (one widening the representation type to
U16, one renumbering FATAL) load without complaint before the change and
raise DictionaryError after; the third checks that removing the type
altogether still leaves the canonical definition standing.

🤖 Generated with Claude Code

…al types (#225)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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