OSDN Git Service

Clear pending exception before throwing a new one.
authorAndy McFadden <fadden@android.com>
Wed, 21 Oct 2009 22:36:48 +0000 (15:36 -0700)
committerAndy McFadden <fadden@android.com>
Wed, 21 Oct 2009 22:36:48 +0000 (15:36 -0700)
commitd1f4cf7b4fc5fd258c99ebbc5e4d2e7dc660df5f
treeab22ade21b7ed81caa30e46286625085704cc14a
parentf0c2999b0ce9645b73776182cd63f8c8dc741fca
Clear pending exception before throwing a new one.

The JNI helper function that throws an exception calls FindClass, which
isn't allowed if an exception is currently pending.  Some of our code
called this when an operation failed without noting that the thing that
failed already threw an exception; this caused the VM to blow up in a
rather unhelpful way.

We now log the class name and optional message from the original
exception, clear it, and then allocate & throw the new one.

For bug 2141867.
libnativehelper/JNIHelp.c