fix 'murphi2c' bugs - #336
Closed
Smattr wants to merge 7 commits into
Closed
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.