am 08d7d44b: Fix image generation.
* commit '08d7d44bc33a7251ff34287422c7751c5a65683d':
Fix image generation.
diff --git a/compiler/dex/dex_to_dex_compiler.cc b/compiler/dex/dex_to_dex_compiler.cc
index 1ee29cb..60e638c 100644
--- a/compiler/dex/dex_to_dex_compiler.cc
+++ b/compiler/dex/dex_to_dex_compiler.cc
@@ -209,8 +209,8 @@
void DexCompiler::CompileReturnVoid(Instruction* inst, uint32_t dex_pc) {
DCHECK(inst->Opcode() == Instruction::RETURN_VOID);
- // Are we compiling a constructor ?
- if ((unit_.GetAccessFlags() & kAccConstructor) == 0) {
+ // Are we compiling a non-clinit constructor?
+ if (!unit_.IsConstructor() || unit_.IsStatic()) {
return;
}
// Do we need a constructor barrier ?
diff --git a/compiler/driver/dex_compilation_unit.h b/compiler/driver/dex_compilation_unit.h
index 5bf0086..465139b 100644
--- a/compiler/driver/dex_compilation_unit.h
+++ b/compiler/driver/dex_compilation_unit.h
@@ -80,6 +80,10 @@
return access_flags_;
}
+ bool IsConstructor() const {
+ return ((access_flags_ & kAccConstructor) != 0);
+ }
+
bool IsNative() const {
return ((access_flags_ & kAccNative) != 0);
}
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index 9f0d911..6cc74de 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -2507,8 +2507,8 @@
// Special instructions.
case Instruction::RETURN_VOID_BARRIER:
- DCHECK(Runtime::Current()->IsStarted());
- if (!IsConstructor()) {
+ DCHECK(Runtime::Current()->IsStarted()) << PrettyMethod(dex_method_idx_, *dex_file_);
+ if (!IsConstructor() || IsStatic()) {
Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "return-void-barrier not expected";
}
break;