summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2020-12-23 17:29:32 +0000
committerNicolas Geoffray <ngeoffray@google.com>2021-01-07 09:09:26 +0000
commit54ed0150a42297a1a5e477d6569619193fcbffd0 (patch)
tree9ba815d49f5222b47f6d81127379c11b8876ba3a /compiler/optimizing/instruction_builder.cc
parenta714dd3f13b67ea2b0caf3ed15e7691cbb94f1a4 (diff)
Handle VERIFY_ERROR_INSTANTIATION in compiler and nterp.
Nterp always supported it, but the compiler was missing a check. Test: test.py Test: 600-verifier-fails Change-Id: I8675ca6f61c68c4152212c81843da8248781f18a
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r--compiler/optimizing/instruction_builder.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index 76ee456b55..3b1086e88e 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -1269,6 +1269,7 @@ HNewInstance* HInstructionBuilder::BuildNewInstance(dex::TypeIndex type_index, u
if (load_class->NeedsAccessCheck() ||
klass == nullptr || // Finalizable/instantiable is unknown.
klass->IsFinalizable() ||
+ klass.Get() == klass->GetClass() || // Classes cannot be allocated in code
!klass->IsInstantiable()) {
entrypoint = kQuickAllocObjectWithChecks;
}