diff options
author | 2014-07-29 15:22:40 -0700 | |
---|---|---|
committer | 2014-08-05 10:22:08 -0700 | |
commit | eb76e11d836ea953b4e40a28e3e69d3b0f4c86fa (patch) | |
tree | ff1167bdd975c6b7a403836011cefd8cfa990714 /compiler | |
parent | 35d9a38d14fe8528310dced6d6a41f112ad95fcd (diff) |
Temporary fix for bad LIR generation in GenInlinedGet.
In GenInlinedGet we will sometimes try to load a class directly. If
we are doing that and find one, but cannot get the direct pointer
(due to image compilation or including patch information) we might
end up generating incorrect patching code due to the changing of the
cu_->dex_file attribute.
Bug: 16656190
Change-Id: I9bada598bf4fd972d6164163eedd4a496da306d6
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/dex/quick/gen_invoke.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/dex/quick/gen_invoke.cc b/compiler/dex/quick/gen_invoke.cc index 8e7f6a6c58..e70b0c5a48 100755 --- a/compiler/dex/quick/gen_invoke.cc +++ b/compiler/dex/quick/gen_invoke.cc @@ -1166,8 +1166,14 @@ bool Mir2Lir::GenInlinedGet(CallInfo* info) { } if (use_direct_type_ptr) { LoadConstant(reg_class, direct_type_ptr); - } else { + } else if (cu_->dex_file == old_dex) { + // TODO: Bug 16656190 If cu_->dex_file != old_dex the patching could retrieve the wrong class + // since the load class is indexed only by the type_idx. We should include which dex file a + // class is from in the LoadClassType LIR. LoadClassType(type_idx, kArg1); + } else { + cu_->dex_file = old_dex; + return false; } cu_->dex_file = old_dex; |