From 8c80783c05b2767140f9229b523c2ce601f31ddf Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 13 Feb 2025 14:54:16 +0000 Subject: verifier: Reject `filled-new-array/-range` with `[J`/`[D`. We were not enforcing the specified requirement from https://source.android.com/docs/core/runtime/dalvik-bytecode for `filled-new-array/-range`. We now reject the descriptors `[J` and `[D` in the verifier and defer arrays of primitive types other than `[I` to the interpreter. All these cases would have previously hit a `DCHECK()` in the compiler. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Iaf91465faa8ed9599abe2504796a2d9bc5bd4678 --- compiler/optimizing/instruction_builder.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'compiler/optimizing/instruction_builder.cc') diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index c8086cff99..f65586f505 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -2552,9 +2552,7 @@ HNewArray* HInstructionBuilder::BuildFilledNewArray(uint32_t dex_pc, const char* descriptor = dex_file_->GetTypeDescriptor(type_index); DCHECK_EQ(descriptor[0], '[') << descriptor; char primitive = descriptor[1]; - DCHECK(primitive == 'I' - || primitive == 'L' - || primitive == '[') << descriptor; + DCHECK(primitive == 'I' || primitive == 'L' || primitive == '[') << descriptor; bool is_reference_array = (primitive == 'L') || (primitive == '['); DataType::Type type = is_reference_array ? DataType::Type::kReference : DataType::Type::kInt32; -- cgit v1.2.3-59-g8ed1b