Check object types when native code returns.
Object references returned by native code were not being type checked,
so it was possible to (for example) return a byte[] when an InetAddress
was expected. This sort of thing can lead to extremely strange behavior.
Now, when "check JNI" is enabled, we insert another layer in the JNI call
sequence that verifies the type of the returned object. This makes calls
to native methods returning an object a bit slower on engineering builds,
but the added type safety is helpful.
I found two failures with this. One fairly harmless one was fixed in
master 1594, the other is filed as internal bug 1851257. The latter does
not seem to cause problems for anything other than the socks5 app that
uncovered it (but it does render SOCKS less than useful).
4 files changed