Skip to content

Java front-end: rule out multiple parallel instances of java_bytecode_languaget #4434

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

Conversation

smowton
Copy link
Contributor

@smowton smowton commented Mar 26, 2019

The front-end, unlike the C front-end, is not designed to be run on a partially populated symbol table.
Ensure we don't do that using an invariant in java_bytecode_languaget::typecheck, and forestall hitting
that invariant with a friendlier error message in the Java frontend programs.

Note jdiff did not require any change as it already insists on exactly two arguments.

@tautschnig I suggest this as an alternative to #4390

…_languaget

The front-end, unlike the C front-end, is not designed to be run on a partially populated symbol table.
Ensure we don't do that using an invariant in java_bytecode_languaget::typecheck, and forestall hitting
that invariant with a friendlier error message in the Java frontend programs.

Note jdiff did not require any change as it already insists on exactly two arguments.
@tautschnig
Copy link
Collaborator

Would you mind also changing the *symbol_table.lookup in java_entry_point.cpp to something like symbol_table.lookup_ref or so such that at least a segmentation fault is avoided? I will then close #4390.

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

@smowton
Copy link
Contributor Author

smowton commented Mar 26, 2019

@tautschnig #4437

@smowton
Copy link
Contributor Author

smowton commented Mar 27, 2019

@tautschnig do you approve now that #4437 is in?

@tautschnig
Copy link
Collaborator

@tautschnig do you approve now that #4437 is in?

Sure, but my approval doesn't really count for Java stuff...

if(cmdline.args.empty())
{
error() << "Please provide a program to verify" << eom;
return 6;
Copy link
Member

Choose a reason for hiding this comment

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

I'd use CPROVER_EXIT_USAGE_ERROR here

"'--lazy-methods-extra-entry-point somepackage.SomeClass.method' along "
"with '--classpath'"
<< messaget::eom;
return 6;
Copy link
Member

Choose a reason for hiding this comment

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

I'd use CPROVER_EXIT_USAGE_ERROR here

@smowton
Copy link
Contributor Author

smowton commented Mar 27, 2019

Nothing else in jbmc_parse_optionst uses the named return values yet, so leaving as-is for now (change en masse welcome of course)

@smowton smowton merged commit 12b5ba9 into diffblue:develop Mar 27, 2019
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