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 1 commit
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
8 changes: 5 additions & 3 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 @@ -26,8 +26,10 @@
import gov.nasa.jpf.vm.NativePeer;
import gov.nasa.jpf.vm.SystemState;
import gov.nasa.jpf.vm.ThreadInfo;
import junit.Test;
Copy link
Member

Choose a reason for hiding this comment

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

Are these two imports needed? You do not (yet) add a new test in this patch.


import static gov.nasa.jpf.vm.JPF_java_lang_Class.FIELD_CLASSNAME;
import static org.junit.Assert.assertTrue;

/**
* we don't want this class! This is a hodgepodge of stuff that shouldn't be in Java, but
Expand All @@ -43,10 +45,10 @@
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;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Please try to avoid introducing extra formatting changes, as this may make it more difficult to merge your patch in other branches later.


@MJI
public long objectFieldOffset__Ljava_lang_reflect_Field_2__J (MJIEnv env, int unsafeRef, int fieldRef) {
Expand All @@ -60,7 +62,7 @@ public void registerNatives____V(MJIEnv env, int clsObjRef) {}
public int addressSize0____I (MJIEnv env, int objRef) {
cyrille-artho marked this conversation as resolved.
Show resolved Hide resolved
return 0;
}

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