summaryrefslogtreecommitdiffstats
path: root/runtime/verifier
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-07-08 17:22:57 -0700
committerAndreas Gampe <agampe@google.com>2015-07-08 18:52:56 -0700
commitc2bf1255ebf360d009dd0763dcea8d2c9b9c676e (patch)
tree0ae9b2b41b48a351f90686b9f988fccb48a5e9d1 /runtime/verifier
parenta3cd834a9e63c4c2259f0ef87d79ddf2c4dd3afb (diff)
downloadart-c2bf1255ebf360d009dd0763dcea8d2c9b9c676e.zip
art-c2bf1255ebf360d009dd0763dcea8d2c9b9c676e.tar.gz
art-c2bf1255ebf360d009dd0763dcea8d2c9b9c676e.tar.bz2
ART: Allow to set and copy conflicts in the verifier
As long as conflicts are not actively being used, it is OK to set them in a register line or copy them around. Bug: 22331663 (cherry picked from commit 38536287f61c9c0fc3bab8c1950cf8c74881482a) Change-Id: I61999e2d9c92f9bdedcb0a5dea54df3c5bb130ca
Diffstat (limited to 'runtime/verifier')
-rw-r--r--runtime/verifier/register_line-inl.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/verifier/register_line-inl.h b/runtime/verifier/register_line-inl.h
index 244deed..9cd2bdf 100644
--- a/runtime/verifier/register_line-inl.h
+++ b/runtime/verifier/register_line-inl.h
@@ -38,10 +38,9 @@ inline bool RegisterLine::SetRegisterType(MethodVerifier* verifier, uint32_t vds
verifier->Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "Expected category1 register type not '"
<< new_type << "'";
return false;
- } else if (new_type.IsConflict()) { // should only be set during a merge
- verifier->Fail(VERIFY_ERROR_BAD_CLASS_SOFT) << "Set register to unknown type " << new_type;
- return false;
} else {
+ // Note: previously we failed when asked to set a conflict. However, conflicts are OK as long
+ // as they are not accessed, and our backends can handle this nowadays.
line_[vdst] = new_type.GetId();
}
// Clear the monitor entry bits for this register.
@@ -93,8 +92,9 @@ inline void RegisterLine::CopyRegister1(MethodVerifier* verifier, uint32_t vdst,
if (!SetRegisterType(verifier, vdst, type)) {
return;
}
- if ((cat == kTypeCategory1nr && !type.IsCategory1Types()) ||
- (cat == kTypeCategoryRef && !type.IsReferenceTypes())) {
+ if (!type.IsConflict() && // Allow conflicts to be copied around.
+ ((cat == kTypeCategory1nr && !type.IsCategory1Types()) ||
+ (cat == kTypeCategoryRef && !type.IsReferenceTypes()))) {
verifier->Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "copy1 v" << vdst << "<-v" << vsrc << " type=" << type
<< " cat=" << static_cast<int>(cat);
} else if (cat == kTypeCategoryRef) {