Skip to content

Ensure Java stubbing names parameters [blocks: #4485] #4502

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
Apr 10, 2019

Conversation

tautschnig
Copy link
Collaborator

For functions with a body we require that parameters are named so that
we can generate assignments to them (even when the body may not read the
value). Also guard against future regressions by sanity checking
parameter names for any converted function.

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

For functions with a body we require that parameters are named so that
we can generate assignments to them (even when the body may not read the
value). Also guard against future regressions by sanity checking
parameter names for any converted function.
@tautschnig tautschnig merged commit 7dd720b into diffblue:develop Apr 10, 2019
@tautschnig tautschnig deleted the parameter-names branch April 10, 2019 10:23
@smowton
Copy link
Contributor

smowton commented Apr 10, 2019

Got to this late, but this should be done when assign_parameter_names is called when a stub function is created in java_bytecode_convert_method.cpp, do you have any idea why that wasn't happening in your case (or should that call be removed now?) Could you submit a followup with whatever test case motivated this?

@tautschnig
Copy link
Collaborator Author

It's jbmc/provide_object_implementation/ that fails without the patch (but the additional sanity check kept in). assign_parameter_names is never called for the symbol at fault (java::java.lang.Class.forName:(Ljava/lang/String;)Ljava/lang/Class;), which gets added into the symbol table in typecheck_expr_symbol. Note that this test uses --no-lazy-methods, which may be important here (I don't think the method at fault is ever invoked, and assign_parameter_names is AFAIK only called for invoked methods).

So I accept that maybe some other place is the right one to fix this, but I don't really have a sufficiently good understanding of the Java front-end to make that change.

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

Successfully merging this pull request may close these issues.

3 participants