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

[TG-7618] Fix precision parsing in string_format #4649

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

romainbrenguier
Copy link
Contributor

@romainbrenguier romainbrenguier commented May 13, 2019

The 4th group in the regular expression matches (\.\d+)? so the dot
should be ignored before the string can be parsed to an int.

  • Each commit message has a non-empty body, explaining why the change was made.
  • [na] Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • [na] My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • [na] White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@romainbrenguier romainbrenguier changed the title Fix precision parsing in string_format [TG-7618] Fix precision parsing in string_format May 13, 2019
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 9c7b44a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/111548705

@tautschnig
Copy link
Collaborator

Would it be possible to include a test?

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Sounds believable but a "fails before but works now" test case, either system or unit, would be good.

The 4th group in the regular expression matches `(\.\d+)?` so the dot
should be ignored before the string can be parsed to an int.
This checks that having a format flag with precision defined doesn't
crash the solver.
@romainbrenguier romainbrenguier force-pushed the bugfix/format-precision branch from 9c7b44a to efc59fd Compare May 17, 2019 09:20
@romainbrenguier
Copy link
Contributor Author

I started adding a test but it will require a model for Float in java-models-library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants