Verifier treats unresolved references as a rewrite error at runtime.
Setting a register to unresolved at runtime causes a verify error that
will prevent it from trying to verify any following instructions. When
the instruction is executed, the compiled code will treat the unresolved
class appropriately.
This makes OTP work, and CTS passes as well.
Change-Id: I6a163253b385fd4007032720bb740b09c57e7cf4
diff --git a/src/verifier/register_line.cc b/src/verifier/register_line.cc
index 085a101..d5477a3 100644
--- a/src/verifier/register_line.cc
+++ b/src/verifier/register_line.cc
@@ -45,6 +45,11 @@
} 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 if (!Runtime::Current()->IsCompiler() && new_type.IsUnresolvedTypes()) {
+ // Unresolvable classes at runtime are bad and marked as a rewrite error.
+ verifier_->Fail(VERIFY_ERROR_NO_CLASS) << "Set register to unresolved class '"
+ << new_type << "' at runtime";
+ return false;
} else {
line_[vdst] = new_type.GetId();
}