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

[DMS-60] Misc fixes #37

Merged
merged 2 commits into from
Jul 2, 2024
Merged

[DMS-60] Misc fixes #37

merged 2 commits into from
Jul 2, 2024

Conversation

DK318
Copy link
Member

@DK318 DK318 commented Jul 1, 2024

In this PR some miscellaneous fixes were applied:

  • Fixed wrong continue translation in while loops.
  • Added locations for pre/post conditions in the source mapper.

continue in While Loops

Previously, we were adding continue labels at the beginning of the while loop. This is not the correct translation because after goto the loop iteration check is skipped.

while (cond) {
  label $lbl$continue$loop;
  ...
  if (cond1) {
    goto $lbl$continue$loop;
  }
}

After going into if (cond1) cond check is skipped.

It's fixed by moving the continue label to the end of the loop.

while (cond) {
  ...
  if (cond1) {
    goto $lbl$continue$loop;
  }
  ...
  label $lbl$continue$loop;
}

Locations for Pre/Post Conditions

We were lack of pre/post conditions locations in the source mapper. If the assertion contains an error the whole method body would be highlighted.

Before

image

After

image

Copy link

@GoPavel GoPavel left a comment

Choose a reason for hiding this comment

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

Great! Thanks

@DK318 DK318 merged commit 7f5bb81 into master Jul 2, 2024
2 of 5 checks passed
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.

2 participants