Skip to content

add Java monitorenter/exit symbols #2286

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

Closed
wants to merge 1 commit into from
Closed

Conversation

kroening
Copy link
Member

@kroening kroening commented Jun 6, 2018

These are needed for any "synchronized" methods.

code_typet type;
type.return_type() = void_typet();
type.parameters().resize(1);
type.parameters()[0].type() = java_reference_type(void_typet());
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps an Object *, since that defines the @lock field they are expected to use?

@tautschnig
Copy link
Collaborator

Marking do-not-merge as per #2280 (comment).

code_typet type;
type.return_type() = void_typet();
type.parameters().resize(1);
type.parameters()[0].type() = java_reference_type(void_typet());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Once the other concerns are addressed, please use the new code_typet constructor that takes two arguments.

@kroening kroening force-pushed the monitorenter-exit branch from d03cf29 to 657d744 Compare June 6, 2018 16:25
@kroening
Copy link
Member Author

kroening commented Jun 6, 2018

Both done

@Degiorgio
Copy link
Contributor

@kroening I don't think this is needed. The critical section is implemented as part of the java-model library (https://github.com/diffblue/java-models-library) in two methods: java.lang.Object.monitorenter:(Ljava/lang/Object;)V and java.lang.Object.monitorexit:(Ljava/lang/Object;)V. Adding stubs for these methods will not functionally change anything (besides preventing JBMC from complaining about missing function bodies when the the models library is not in the class path and the code under analysis contains the synchronized keyword)

@NlightNFotis
Copy link
Contributor

Hi @tautschnig, would it be possible for this to be rebased on top of current develop?

@tautschnig
Copy link
Collaborator

Hi @tautschnig, would it be possible for this to be rebased on top of current develop?

I guess it's up to @kroening for this one - based on earlier comments it's not clear to me whether this is needed at all.

@peterschrammel
Copy link
Member

I think this can be closed as obsolete.

@NlightNFotis
Copy link
Contributor

I am going forward with closing this as previous comments indicate this is now obsolete.

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.

6 participants