diff options
author | Ian Rogers <irogers@google.com> | 2013-07-29 14:35:46 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2013-07-29 14:45:07 -0700 |
commit | c449aa8151bf81d93d22ff24677ccf09a6da218e (patch) | |
tree | 343274bb1e635bc503ae0ffc44c68ec44f6b69e5 /runtime/interpreter/interpreter.cc | |
parent | c95d6b1cb35b382804b9a310d32f66059eca65d9 (diff) | |
download | art-c449aa8151bf81d93d22ff24677ccf09a6da218e.zip art-c449aa8151bf81d93d22ff24677ccf09a6da218e.tar.gz art-c449aa8151bf81d93d22ff24677ccf09a6da218e.tar.bz2 |
Clear exception if catch block doesn't have move-exception.
Bug: 10040419
Change-Id: Icc7a55cb3cdfbc3efd2b161bbe22b3e5007de35f
Diffstat (limited to 'runtime/interpreter/interpreter.cc')
-rw-r--r-- | runtime/interpreter/interpreter.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc index 8d7d028..37c45fa 100644 --- a/runtime/interpreter/interpreter.cc +++ b/runtime/interpreter/interpreter.cc @@ -975,7 +975,9 @@ static inline const Instruction* FindNextInstructionFollowingException(Thread* s self->VerifyStack(); ThrowLocation throw_location; mirror::Throwable* exception = self->GetException(&throw_location); - uint32_t found_dex_pc = shadow_frame.GetMethod()->FindCatchBlock(exception->GetClass(), dex_pc); + bool clear_exception; + uint32_t found_dex_pc = shadow_frame.GetMethod()->FindCatchBlock(exception->GetClass(), dex_pc, + &clear_exception); if (found_dex_pc == DexFile::kDexNoIndex) { instrumentation->MethodUnwindEvent(self, this_object_ref.get(), shadow_frame.GetMethod(), dex_pc); @@ -984,6 +986,9 @@ static inline const Instruction* FindNextInstructionFollowingException(Thread* s instrumentation->ExceptionCaughtEvent(self, throw_location, shadow_frame.GetMethod(), found_dex_pc, exception); + if (clear_exception) { + self->ClearException(); + } return Instruction::At(insns + found_dex_pc); } } |