summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2014-05-21 10:07:42 +0200
committerSebastien Hertz <shertz@google.com>2014-05-21 10:08:31 +0200
commit5c0049067a953d7a2383d3064a84a32d1efa3a24 (patch)
treebe0377c1348c8aea84a7308fd5977657b8f3622d /runtime
parentbf17a08fb48fa296acb09904d4c10ba42f63f55d (diff)
downloadandroid_art-5c0049067a953d7a2383d3064a84a32d1efa3a24.tar.gz
android_art-5c0049067a953d7a2383d3064a84a32d1efa3a24.tar.bz2
android_art-5c0049067a953d7a2383d3064a84a32d1efa3a24.zip
Secure move-exception in intepreter
Copies exception into the shadow frame before clearing it from its thread so it's always reachable. Change-Id: Ifdc68280424f5099aacf0724da94889881a99551
Diffstat (limited to 'runtime')
-rw-r--r--runtime/interpreter/interpreter_goto_table_impl.cc4
-rw-r--r--runtime/interpreter/interpreter_switch_impl.cc4
2 files changed, 4 insertions, 4 deletions
diff --git a/runtime/interpreter/interpreter_goto_table_impl.cc b/runtime/interpreter/interpreter_goto_table_impl.cc
index e0f9e5f958..9a274f618a 100644
--- a/runtime/interpreter/interpreter_goto_table_impl.cc
+++ b/runtime/interpreter/interpreter_goto_table_impl.cc
@@ -234,9 +234,9 @@ JValue ExecuteGotoImpl(Thread* self, MethodHelper& mh, const DexFile::CodeItem*
HANDLE_INSTRUCTION_END();
HANDLE_INSTRUCTION_START(MOVE_EXCEPTION) {
- Throwable* exception = self->GetException(NULL);
- self->ClearException();
+ Throwable* exception = self->GetException(nullptr);
shadow_frame.SetVRegReference(inst->VRegA_11x(inst_data), exception);
+ self->ClearException();
ADVANCE(1);
}
HANDLE_INSTRUCTION_END();
diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl.cc
index c1d24f5a5f..deb897a14a 100644
--- a/runtime/interpreter/interpreter_switch_impl.cc
+++ b/runtime/interpreter/interpreter_switch_impl.cc
@@ -163,9 +163,9 @@ JValue ExecuteSwitchImpl(Thread* self, MethodHelper& mh, const DexFile::CodeItem
break;
case Instruction::MOVE_EXCEPTION: {
PREAMBLE();
- Throwable* exception = self->GetException(NULL);
- self->ClearException();
+ Throwable* exception = self->GetException(nullptr);
shadow_frame.SetVRegReference(inst->VRegA_11x(inst_data), exception);
+ self->ClearException();
inst = inst->Next_1xx();
break;
}