diff options
author | Sebastien Hertz <shertz@google.com> | 2014-04-22 09:23:39 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-04-22 09:23:40 +0000 |
commit | 618a87009202dc959c935ed8f237ae32bdec57d0 (patch) | |
tree | 905c57ff2edb26e58f81b03e753378880dd20a7a /runtime/instrumentation.cc | |
parent | 00256f3e03adaf11b8fbb8bb8b7a11a9c316127d (diff) | |
parent | bf079fe015e3b2d966e111efc61728b6e6892ec3 (diff) | |
download | art-618a87009202dc959c935ed8f237ae32bdec57d0.zip art-618a87009202dc959c935ed8f237ae32bdec57d0.tar.gz art-618a87009202dc959c935ed8f237ae32bdec57d0.tar.bz2 |
Merge "Fix crash when debugging exception"
Diffstat (limited to 'runtime/instrumentation.cc')
-rw-r--r-- | runtime/instrumentation.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/instrumentation.cc b/runtime/instrumentation.cc index dd73e66..2cd7f49 100644 --- a/runtime/instrumentation.cc +++ b/runtime/instrumentation.cc @@ -800,7 +800,10 @@ void Instrumentation::ExceptionCaughtEvent(Thread* thread, const ThrowLocation& if (have_exception_caught_listeners_) { DCHECK_EQ(thread->GetException(NULL), exception_object); thread->ClearException(); - for (InstrumentationListener* listener : exception_caught_listeners_) { + // TODO: The copy below is due to the debug listener having an action where it can remove + // itself as a listener and break the iterator. The copy only works around the problem. + std::list<InstrumentationListener*> copy(exception_caught_listeners_); + for (InstrumentationListener* listener : copy) { listener->ExceptionCaught(thread, throw_location, catch_method, catch_dex_pc, exception_object); } thread->SetException(throw_location, exception_object); |