Fix location of ICCEs and NoSuchMethodErrors.
Also add detail as to why verifier believes an ICCE.
Change-Id: Ie16ea2847fb94e157969c560a780c9345b1e7441
diff --git a/src/verifier/method_verifier.cc b/src/verifier/method_verifier.cc
index 0cdff83..9c0e380 100644
--- a/src/verifier/method_verifier.cc
+++ b/src/verifier/method_verifier.cc
@@ -2596,8 +2596,8 @@
(method_type == METHOD_STATIC && !res_method->IsStatic()) ||
((method_type == METHOD_VIRTUAL || method_type == METHOD_INTERFACE) && res_method->IsDirect())
) {
- Fail(VERIFY_ERROR_CLASS_CHANGE) << "invoke type does not match method type of "
- << PrettyMethod(res_method);
+ Fail(VERIFY_ERROR_CLASS_CHANGE) << "invoke type (" << method_type << ") does not match method "
+ " type of " << PrettyMethod(res_method);
return NULL;
}
return res_method;
diff --git a/src/verifier/method_verifier.h b/src/verifier/method_verifier.h
index 3c15c10..273552d 100644
--- a/src/verifier/method_verifier.h
+++ b/src/verifier/method_verifier.h
@@ -71,6 +71,7 @@
METHOD_VIRTUAL, // virtual, super
METHOD_INTERFACE // interface
};
+std::ostream& operator<<(std::ostream& os, const MethodType& rhs);
/*
* An enumeration of problems that can turn up during verification.