The JNI PopLocalFrame() function isn't safe to use when an exception is pending, using it when the JVM is run with the "-verbose:jni -Xcheck:jni" flags set results in a fatal JVM error. The JNI documentation says it is necessary to check for exceptions after every JNI call that may throw an exception, and it also strongly recommends the use of PushLocalFrame/PopLocalFrame for local reference management. These two recommendations are pretty much in conflict because PopLocalFrame can't be called when an exception is pending.
PopLocalFrame should be made pending-exception safe, like all the other JNI functions that can be used to free local references.