OSDN Git Service

Add check that TypeIndex is valid in StringByTypeIdx.
authorJeff Hao <jeffhao@google.com>
Fri, 14 Apr 2017 21:33:52 +0000 (14:33 -0700)
committerJeff Hao <jeffhao@google.com>
Sat, 15 Apr 2017 01:00:08 +0000 (01:00 +0000)
commit120504f52b5feedcb9ad7dedc54d7618a2f2c31b
treee03daac7c8b52a76edbf96a3c7d687c227111587
parentc569d4a08378aa8f832e89f25df0abde47158836
Add check that TypeIndex is valid in StringByTypeIdx.

StringByTypeIdx should fail gracefully if given a bad TypeIndex. This
adds a check that the TypeIndex is valid before getting its TypeId.

This fixes a regression that removed this check when it was refactored
in this CL: https://android-review.googlesource.com/#/c/243493/

Bug: 37287051
Test: mm -j31 test-art-host-gtest-dex_file_test
Change-Id: Ib68cb8135011f5f30335251583e181b089982754
runtime/dex_file-inl.h
runtime/dex_file_test.cc