diff --git a/src/avian/classpath-common.h b/src/avian/classpath-common.h index afc699383a..a45b4f01f3 100644 --- a/src/avian/classpath-common.h +++ b/src/avian/classpath-common.h @@ -611,11 +611,11 @@ void intercept(Thread* t, if (m) { PROTECT(t, m); - m->flags() |= ACC_NATIVE; - if (updateRuntimeData) { GcMethod* clone = methodClone(t, m); + m->flags() |= ACC_NATIVE; + // make clone private to prevent vtable updates at compilation // time. Otherwise, our interception might be bypassed by calls // through the vtable. @@ -628,6 +628,8 @@ void intercept(Thread* t, GcMethodRuntimeData* runtimeData = getMethodRuntimeData(t, m); runtimeData->setNative(t, native->as(t)); + } else { + m->flags() |= ACC_NATIVE; } } else { // If we can't find the method, just ignore it, since ProGuard may