Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some bugs relating to machine integer literals #1172

Merged
merged 3 commits into from
Dec 5, 2024
Merged

Conversation

dwightguth
Copy link
Collaborator

I discovered 2 bugs relating to machine integer literals that are fixed by this PR:

  1. If a MInt literal appeared in the initial configuration, its value would be changed by the code that creates the initial configuration term.
  2. If an MInt literal appeared in a rule, the rule would match against the incorrect value of integer.

@rv-jenkins rv-jenkins changed the base branch from master to develop December 3, 2024 18:38
@virgil-serbanuta
Copy link
Contributor

I'm curious, is bug 1 in the PR description the same as this issue: runtimeverification/k#4609 ?

@dwightguth
Copy link
Collaborator Author

Yes.

@dwightguth dwightguth marked this pull request as ready for review December 5, 2024 16:46
std::string precision_str = str.substr(idx + 1);
long long precision = std::stoll(precision_str);
long long precision_in_bytes = (precision + 7) / 8;
char *token = (char *)malloc(precision_in_bytes);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you remind me where we handle the deallocation of this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It looks like this memory might be leaking currently; it's supposed to be freed by the configuration parser once it's no longer needed, but I don't see that happening currently. This is not a regression though; the same thing is already happening with other terms in the configuration parser.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it. Should we add an issue in this repo so we don't lose track of this?

Copy link
Collaborator

@Robertorosmaninho Robertorosmaninho left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Collaborator

@theo25 theo25 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@dwightguth dwightguth merged commit dfcadbe into develop Dec 5, 2024
10 checks passed
@dwightguth dwightguth deleted the mint2 branch December 5, 2024 20:02
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.

4 participants