summaryrefslogtreecommitdiff
path: root/runtime/method_handles.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/method_handles.cc')
-rw-r--r--runtime/method_handles.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/method_handles.cc b/runtime/method_handles.cc
index a992af0cc1..059a33f079 100644
--- a/runtime/method_handles.cc
+++ b/runtime/method_handles.cc
@@ -290,6 +290,13 @@ bool ConvertJValueCommon(
return false;
}
+ ObjPtr<mirror::Class> from_obj_type = from_obj->GetClass();
+ Primitive::Type from_primitive_type;
+ if (!GetUnboxedPrimitiveType(from_obj_type, &from_primitive_type)) {
+ ThrowClassCastException(from, to);
+ return false;
+ }
+
Primitive::Type unboxed_type;
JValue unboxed_value;
if (UNLIKELY(!GetUnboxedTypeAndValue(from_obj, &unboxed_type, &unboxed_value))) {