Skip to content
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

fixing issue Orphan NativePeer method with Java 11.0.20.1 #421 #431

Closed
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions src/peers/gov/nasa/jpf/vm/JPF_jdk_internal_misc_Unsafe.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import gov.nasa.jpf.vm.SystemState;
import gov.nasa.jpf.vm.ThreadInfo;


import static gov.nasa.jpf.vm.JPF_java_lang_Class.FIELD_CLASSNAME;

/**
Expand All @@ -43,24 +44,21 @@
public class JPF_jdk_internal_misc_Unsafe extends NativePeer {

@MJI
public int getUnsafe____Lsun_misc_Unsafe_2 (MJIEnv env, int clsRef) {
public int getUnsafe____Ljdk_internal_misc_Unsafe_2(MJIEnv env, int clsRef) {
int objRef = env.getStaticReferenceField("jdk.internal.misc.Unsafe", "theUnsafe");
return objRef;
}
return objRef;
}

@MJI
public long objectFieldOffset__Ljava_lang_reflect_Field_2__J (MJIEnv env, int unsafeRef, int fieldRef) {
public long objectFieldOffset__Ljava_lang_reflect_Field_2__J(MJIEnv env, int unsafeRef, int fieldRef) {
Copy link
Member

Choose a reason for hiding this comment

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

Please add the space before the "(" back so we do not have extra changes in the patch; this is important to make future merges to other branches easier.

return fieldOffset__Ljava_lang_reflect_Field_2__I(env, unsafeRef, fieldRef);
}

@MJI
public void registerNatives____V(MJIEnv env, int clsObjRef) {}

@MJI
public int addressSize0____I (MJIEnv env, int objRef) {
cyrille-artho marked this conversation as resolved.
Show resolved Hide resolved
return 0;
public void registerNatives____V(MJIEnv env, int clsObjRef) {
// No changes here as suggested
}

Copy link
Member

Choose a reason for hiding this comment

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

Try to remove this change as well.

Copy link
Member

Choose a reason for hiding this comment

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

Can you please revert the second change that swaps the two methods, so we have a patch that only has the first (functional) change?

@MJI
public boolean isBigEndian0____Z (MJIEnv env, int objRef) {
return true;
Expand Down
Loading