diff options
author | 2024-04-09 12:49:48 +0000 | |
---|---|---|
committer | 2024-04-11 15:10:07 +0000 | |
commit | e8da7cd1d0e7d3535c82f8d05adcef3edd43cd40 (patch) | |
tree | f39114f368998a7b6415bb905fa71dc04dc3b232 /compiler/exception_test.cc | |
parent | 69dc24557f951ce2513d0ea77f35a499fa58467b (diff) |
Clean up string data access in `DexFile`.
The `*ByIdx()` and `*ByTypeIdx()` functions were doing
validity checks that were needed only for processing the
debug data, so move the checks to these callers. Replace
these functions with new overloads of other functions to
provide consistent naming.
In a few cases, rewrite calls to these functions to fetch
and work with a `string_view` instead.
Rename `GetStringLength()` to `GetStringUtf16Length()` and
change its return type to `uint32_t`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I561899606f6e5ec5f23aa4be617349dacdb376e3
Diffstat (limited to 'compiler/exception_test.cc')
-rw-r--r-- | compiler/exception_test.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/exception_test.cc b/compiler/exception_test.cc index 3c7ff0a984..89fe56dda0 100644 --- a/compiler/exception_test.cc +++ b/compiler/exception_test.cc @@ -159,17 +159,17 @@ TEST_F(ExceptionTest, FindCatchHandler) { EXPECT_LE(t0.start_addr_, t1.start_addr_); { CatchHandlerIterator iter(accessor, 4 /* Dex PC in the first try block */); - EXPECT_STREQ("Ljava/io/IOException;", dex_->StringByTypeIdx(iter.GetHandlerTypeIndex())); + EXPECT_STREQ("Ljava/io/IOException;", dex_->GetTypeDescriptor(iter.GetHandlerTypeIndex())); ASSERT_TRUE(iter.HasNext()); iter.Next(); - EXPECT_STREQ("Ljava/lang/Exception;", dex_->StringByTypeIdx(iter.GetHandlerTypeIndex())); + EXPECT_STREQ("Ljava/lang/Exception;", dex_->GetTypeDescriptor(iter.GetHandlerTypeIndex())); ASSERT_TRUE(iter.HasNext()); iter.Next(); EXPECT_FALSE(iter.HasNext()); } { CatchHandlerIterator iter(accessor, 8 /* Dex PC in the second try block */); - EXPECT_STREQ("Ljava/io/IOException;", dex_->StringByTypeIdx(iter.GetHandlerTypeIndex())); + EXPECT_STREQ("Ljava/io/IOException;", dex_->GetTypeDescriptor(iter.GetHandlerTypeIndex())); ASSERT_TRUE(iter.HasNext()); iter.Next(); EXPECT_FALSE(iter.HasNext()); |