diff --git a/src/compile.cpp b/src/compile.cpp index 3bd85c34fa..24fd2077fc 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -4641,7 +4641,9 @@ compileVirtualMethod2(MyThread* t, object class_, unsigned index) return 0; } else { void* address = reinterpret_cast(methodAddress(t, target)); - if (address != reinterpret_cast(nativeThunk(t))) { + if (methodFlags(t, target) & ACC_NATIVE) { + t->trace->nativeMethod = target; + } else { classVtable(t, class_, methodOffset(t, target)) = address; } return address;