Pass correct is_static to ResolveField.
Change-Id: I35ca25cd1b80b09c4e1e34d30c835d7dbd249b9e
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 61e9fbb..9bfd170 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -980,12 +980,12 @@
}
static mirror::ArtField* ComputeFieldReferencedFromCompilingMethod(
- ScopedObjectAccess& soa, const DexCompilationUnit* mUnit, uint32_t field_idx)
+ ScopedObjectAccess& soa, const DexCompilationUnit* mUnit, uint32_t field_idx, bool is_static)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
SirtRef<mirror::DexCache> dex_cache(soa.Self(), mUnit->GetClassLinker()->FindDexCache(*mUnit->GetDexFile()));
SirtRef<mirror::ClassLoader> class_loader(soa.Self(), soa.Decode<mirror::ClassLoader*>(mUnit->GetClassLoader()));
return mUnit->GetClassLinker()->ResolveField(*mUnit->GetDexFile(), field_idx, dex_cache,
- class_loader, false);
+ class_loader, is_static);
}
static mirror::ArtMethod* ComputeMethodReferencedFromCompilingMethod(ScopedObjectAccess& soa,
@@ -1030,7 +1030,8 @@
*field_offset = -1;
*is_volatile = true;
// Try to resolve field and ignore if an Incompatible Class Change Error (ie is static).
- mirror::ArtField* resolved_field = ComputeFieldReferencedFromCompilingMethod(soa, mUnit, field_idx);
+ mirror::ArtField* resolved_field =
+ ComputeFieldReferencedFromCompilingMethod(soa, mUnit, field_idx, false);
if (resolved_field != NULL && !resolved_field->IsStatic()) {
SirtRef<mirror::DexCache> dex_cache(soa.Self(),
resolved_field->GetDeclaringClass()->GetDexCache());
@@ -1070,7 +1071,8 @@
*is_volatile = true;
*is_initialized = false;
// Try to resolve field and ignore if an Incompatible Class Change Error (ie isn't static).
- mirror::ArtField* resolved_field = ComputeFieldReferencedFromCompilingMethod(soa, mUnit, field_idx);
+ mirror::ArtField* resolved_field =
+ ComputeFieldReferencedFromCompilingMethod(soa, mUnit, field_idx, true);
if (resolved_field != NULL && resolved_field->IsStatic()) {
SirtRef<mirror::DexCache> dex_cache(soa.Self(), resolved_field->GetDeclaringClass()->GetDexCache());
mirror::Class* referrer_class =