From 149cddaa22a1a78e8dde179d2c33b745cb500629 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 12 Nov 2019 15:02:51 +0000 Subject: Check stored references in transactional interpreter. For boot image extension, we need to reject references to classes that are defined in a dex file belonging to the boot image we're compiling against but not actually in the boot image. Allowing such references could yield duplicate class objects from multiple extensions. Test: Additional tests in transaction_test. Test: m test-art-host-gtest Test: testrunner.py --host --interp-ac Change-Id: I99eaec331f6d992dba60aeb98a88c268edac11ac --- runtime/interpreter/interpreter_switch_impl-inl.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/interpreter/interpreter_switch_impl-inl.h') diff --git a/runtime/interpreter/interpreter_switch_impl-inl.h b/runtime/interpreter/interpreter_switch_impl-inl.h index 8afaed5cde..989f99740e 100644 --- a/runtime/interpreter/interpreter_switch_impl-inl.h +++ b/runtime/interpreter/interpreter_switch_impl-inl.h @@ -974,6 +974,9 @@ class InstructionHandler { ObjPtr val = GetVRegReference(A()); ObjPtr> array = a->AsObjectArray(); if (array->CheckIsValidIndex(index) && array->CheckAssignable(val)) { + if (transaction_active && !CheckWriteValueConstraint(self, val)) { + return false; + } array->SetWithoutChecks(index, val); } else { return false; // Pending exception. -- cgit v1.2.3-59-g8ed1b