Skip to content

Fix String initialiser type when java.lang.String is a stub #3657

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

Conversation

owen-mc-diffblue
Copy link
Contributor

Previously it was accidentally given type java.lang.Object, but we
didn't notice because we were less stringent about verifying type
equality (or, in transitioning from ID_symbol to ID_struct_tag for
Java types, we've become less generous about permitting a structural
match but name mismatch). Either way it was clearly wrong to assign
a wrong type like this.

  • Each commit message has a non-empty body, explaining why the change was made.
  • 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).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@smowton
Copy link
Contributor

smowton commented Jan 2, 2019

@owen-jones-diffblue please add a test for this -- janalyzer is actually a perfect vessel to test this as it can run the constant propagator, which checks for type consistency. I can reproduce the crash with janalyzer test.class --location-sensitive --constants --show, where test.class contains any string literal operations.

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: 1365f8b).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/96094506

Owen Jones added 2 commits January 3, 2019 11:41
Previously it was accidentally given type java.lang.Object, but we
didn't notice because we were less stringent about verifying type
equality (or, in transitioning from ID_symbol to ID_struct_tag for
Java types, we've become less generous about permitting a structural
match but name mismatch). Either way it was clearly wrong to assign
a wrong type like this.
@owen-mc-diffblue owen-mc-diffblue force-pushed the fix-string-initialiser-type branch from 1365f8b to 101e46e Compare January 3, 2019 11:42
@owen-mc-diffblue
Copy link
Contributor Author

I've added a test using janalyzer, and also a fix required to get janalyzer to run properly.

@@ -7,6 +7,7 @@ add_subdirectory(jbmc)
add_subdirectory(strings-smoke-tests)
add_subdirectory(jbmc-strings)
add_subdirectory(jdiff)
add_subdirectory(janalyzer)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please also add it to the Makefile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops. Well spotted.

@owen-mc-diffblue owen-mc-diffblue force-pushed the fix-string-initialiser-type branch from 101e46e to 54301b1 Compare January 3, 2019 12:25
@owen-mc-diffblue owen-mc-diffblue force-pushed the fix-string-initialiser-type branch from 54301b1 to 0d96b0d Compare January 3, 2019 12:58
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.

🚫
This PR failed Diffblue compatibility checks (cbmc commit: 101e46e).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/96178128
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

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: 0d96b0d).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/96192263

@owen-mc-diffblue owen-mc-diffblue merged commit f4fbcc7 into diffblue:develop Jan 3, 2019
@owen-mc-diffblue owen-mc-diffblue deleted the fix-string-initialiser-type branch January 3, 2019 16:56
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.

5 participants