Clean up kAccWritable in the verifier.
kAccVerifier was deprecated, instead memory permissions were used in its
stead.
Move dead code scanning in the verifier to be enabled when the results
will be logged.
Change-Id: Id20e62eefe958bd577b86bd7396a439d7a01c1b3
diff --git a/src/verifier/method_verifier.cc b/src/verifier/method_verifier.cc
index 9082172..0a487e3 100644
--- a/src/verifier/method_verifier.cc
+++ b/src/verifier/method_verifier.cc
@@ -1249,7 +1249,7 @@
insn_flags_[insn_idx].ClearChanged();
}
- if (DEAD_CODE_SCAN && ((method_access_flags_ & kAccWritable) == 0)) {
+ if (gDebugVerify) {
/*
* Scan for dead code. There's nothing "evil" about dead code
* (besides the wasted space), but it indicates a flaw somewhere
@@ -3073,6 +3073,9 @@
<< PrettyMethod(method_idx_, *dex_file_) << " " << failure_message->str();
return;
}
+
+ CHECK_EQ(dex_file_->GetPermissions() & PROT_WRITE, PROT_WRITE); // Dex file needs to be writable.
+
const Instruction* inst = Instruction::At(code_item_->insns_ + work_insn_idx_);
DCHECK(inst->IsThrow()) << "Expected instruction that will throw " << inst->Name();
VerifyErrorRefType ref_type;