Closed lostdj closed 9 years ago
Yeah, it looks like it might be wrong, but I'm surprised we haven't noticed a problem with it before. Do you have a test case that demonstrates the error?
Anyway, yeah, I think the solution will be to make the clone first, then set m->flags() |= ACC_PRIVATE
, so the clone's flags don't change.
Do you have a test case that demonstrates the error?
I do not, they do: http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/42770c335bf7/src/java.base/share/classes/java/io/FileInputStream.java#l187 :)
Is there a reason for marking the original method as native in intercept(): https://github.com/ReadyTalk/avian/blob/master/src/avian/classpath-common.h#L614 ?
I have a managed intercepted method which will fail to invoke() again provided the original GcMethod reference. It's going to look for its native original impl and there is none.
Edit: I think I understand. You can either provide pointer to your
function
, or let it find a JNI interceptor function to call. So is it okay to make a clone of the original method regardless ofupdateRuntimeData
value, and keep original'sm->flags()
unchanged?