OSDN Git Service

Fix broken DCHECK.
authorAlex Light <allight@google.com>
Wed, 12 Apr 2017 16:01:47 +0000 (09:01 -0700)
committerAlex Light <allight@google.com>
Wed, 12 Apr 2017 16:01:47 +0000 (09:01 -0700)
The DCHECK in ti_class_definition was incorrectly checking that the
original dex file was a primitive long instead of a boxed long.

Bug: 37271822
Test: ./test/testrunner/testrunner.py --host --jvmti-stress -j40
Change-Id: I901c6e2f6f93dca584faff70134cee957d8462c3

runtime/openjdkjvmti/ti_class_definition.cc

index 153692b..0671105 100644 (file)
@@ -102,7 +102,9 @@ static jvmtiError GetDexDataForRetransformation(ArtJvmTiEnv* env,
       } else if (orig_dex->IsDexCache()) {
         dex_file = orig_dex->AsDexCache()->GetDexFile();
       } else {
-        DCHECK_EQ(orig_dex->GetClass()->GetPrimitiveType(), art::Primitive::kPrimLong);
+        DCHECK(orig_dex->GetClass()->DescriptorEquals("Ljava/lang/Long;"))
+            << "Expected java/lang/Long but found object of type "
+            << orig_dex->GetClass()->PrettyClass();
         art::ObjPtr<art::mirror::Class> prim_long_class(
             art::Runtime::Current()->GetClassLinker()->GetClassRoot(
                 art::ClassLinker::kPrimitiveLong));