Ensure we don't AddLocalReference a bogus value when returning to native code from an upcall that threw.
Also add a few missing CHECKs.
Change-Id: Icf29506b258a2177b5e80c75cd2710761431ba4b
diff --git a/src/thread.cc b/src/thread.cc
index 125480e..4177913 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -1562,6 +1562,7 @@
CHECK_NE(catch_native_pc, 0u);
long_jump_context->SetSP(reinterpret_cast<uintptr_t>(catch_finder.handler_frame_.GetSP()));
long_jump_context->SetPC(catch_native_pc);
+ long_jump_context->SmashCallerSaves();
long_jump_context->DoLongJump();
LOG(FATAL) << "UNREACHABLE";
}