From f665f847744aef65f8d4ad46cbf410f911dbfb25 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 15 Feb 2018 12:29:06 +0000 Subject: Pass the right dex_file/method_index for String.. Passing the dex file of the caller in instruction_builder.cc was problematic as this information get lost at the point of RTP. test: test.py Change-Id: I3f620b931544a538386d23c2456b182b3ed41091 --- compiler/optimizing/instruction_builder.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/instruction_builder.cc') diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index 64a1eccf60..a38e2717cf 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -960,14 +960,18 @@ bool HInstructionBuilder::BuildInvoke(const Instruction& instruction, HInvokeStaticOrDirect::CodePtrLocation::kCallArtMethod, dchecked_integral_cast(string_init_entry_point) }; - MethodReference target_method(dex_file_, method_idx); + ScopedObjectAccess soa(Thread::Current()); + MethodReference target_method(resolved_method->GetDexFile(), + resolved_method->GetDexMethodIndex()); + // We pass null for the resolved_method to ensure optimizations + // don't rely on it. HInvoke* invoke = new (allocator_) HInvokeStaticOrDirect( allocator_, number_of_arguments - 1, DataType::Type::kReference /*return_type */, dex_pc, method_idx, - nullptr, + nullptr /* resolved_method */, dispatch_info, invoke_type, target_method, -- cgit v1.2.3-59-g8ed1b