It would be helpful to have a special error-checking JNI implementation. One thing we could check is the constraint that it is invalid to make a JNI call if there is an exception pending.
Another thing we could check (a la Sable) is that a call doesn't use more than 16 local references (without asking for more) -- Summary: Optional JNI error checking Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libgcj AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tromey at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19512