Skip to content

address_mapt keys are std::size_t #3035

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

Merged
merged 1 commit into from
Sep 24, 2018

Conversation

tautschnig
Copy link
Collaborator

... as that's the type of keys being used during lookup.

  • Each commit message has a non-empty body, explaining why the change was made.
  • My contribution is formatted in line with CODING_STANDARD.md.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • 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.

Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

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

These are offsets within a Java method, which has a hard 64KB maximum. Therefore suggest the actual correct type is uint16_t, or perhaps uint32_t if you want to be safe re: casually adding two of them together without overflow, or make sure you can express UINT16_T_MAX + 1 to talk about a limit. It probably shouldn't vary in size from platform to platform like size_t though

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

@tautschnig
Copy link
Collaborator Author

These are offsets within a Java method, which has a hard 64KB maximum.

Thanks a lot for the info. I have rewritten this patch to uniformly use a typedef-name (method_offsett) wherever an address/method offset is used.

Java methods have a hard limit of 64KB. Use uint16_t (wrapped in a typedef
method_offsett) to represent these offsets. Avoid mixing unsigneds of different
widths.
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: 4647122).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85755311
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).

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: 57cd9c1).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85755782

@tautschnig tautschnig merged commit 5202f4a into diffblue:develop Sep 24, 2018
@tautschnig tautschnig deleted the address_mapt branch September 24, 2018 21:11
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