diff options
author | 2025-02-13 14:54:16 +0000 | |
---|---|---|
committer | 2025-02-14 07:39:37 -0800 | |
commit | 8c80783c05b2767140f9229b523c2ce601f31ddf (patch) | |
tree | 722bebe84fa8581421f5e9f44398acab4a4b3453 /compiler/optimizing/instruction_builder.cc | |
parent | ce10dc6fbdeaef31f0e7ff6e80e0678cb3e13e94 (diff) |
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
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r-- | compiler/optimizing/instruction_builder.cc | 4 |
1 files changed, 1 insertions, 3 deletions
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; |