Skip to content

fix 'murphi2c' bugs - #336

Closed
Smattr wants to merge 7 commits into
mainfrom
smattr/1cd931e2-df32-42ad-a379-6758ac174ccc
Closed

fix 'murphi2c' bugs#336
Smattr wants to merge 7 commits into
mainfrom
smattr/1cd931e2-df32-42ad-a379-6758ac174ccc

Conversation

@Smattr

@Smattr Smattr commented Aug 14, 2026

Copy link
Copy Markdown
Owner

No description provided.

Smattr added 7 commits August 15, 2026 08:27
These functions were originally defined to return strings with the
assumptions that (1) callers were only ever invoking them to then write
the result into a C source file and (2) the bound value might be
something not generation-time constant. In the current implementation it
can be observed that (2) was not actually true. Upcoming changes to
implement `union` require inspecting the values returned from these
bound functions in a way that is hacky as long as they are strings. So
(1) now no longer seems true either. Lets undo these assumptions by
giving callers something more flexible to deal with.
…xing

Using a value type like `signed char` would result in generated code
that failed to compile. Aside from fixing this problem, this change also
leads to more intuitive looking generated code.
This avoids the value of a numeric literal being first interpreted as an
`int` with possible truncation before casting it to its eventual type.
Similar to the prior change to address this in array indexing, this not
only fixes a bug but leads to more intuitive generated code.
@Smattr Smattr closed this Aug 14, 2026
@Smattr
Smattr deleted the smattr/1cd931e2-df32-42ad-a379-6758ac174ccc branch August 14, 2026 23:37
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