summaryrefslogtreecommitdiffstats
path: root/runtime/intern_table.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-03-21 14:09:35 -0700
committerMathieu Chartier <mathieuc@google.com>2014-03-21 15:28:33 -0700
commited0fc1d42f097be7bed090f19abdf7c0fd227820 (patch)
tree36982a427f36024e6bbec9fda7e2eacadd320fa8 /runtime/intern_table.cc
parentfaa93b3ab455492dad1a9d3fb630e3936d389c85 (diff)
downloadart-ed0fc1d42f097be7bed090f19abdf7c0fd227820.zip
art-ed0fc1d42f097be7bed090f19abdf7c0fd227820.tar.gz
art-ed0fc1d42f097be7bed090f19abdf7c0fd227820.tar.bz2
Don't return null for null utf in AllocFromModifiedUtf8.
If you pass in a null utf string it should not be the same behavior as out of memory. This previously caused serious problems in: https://android-review.googlesource.com/#/c/80768/ Change-Id: I9dfb710b57f6cc91064812f52a3db64254769461
Diffstat (limited to 'runtime/intern_table.cc')
-rw-r--r--runtime/intern_table.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/intern_table.cc b/runtime/intern_table.cc
index 524798d..dfc82dd 100644
--- a/runtime/intern_table.cc
+++ b/runtime/intern_table.cc
@@ -242,15 +242,15 @@ mirror::String* InternTable::Insert(mirror::String* s, bool is_strong) {
return InsertWeak(s, hash_code);
}
-mirror::String* InternTable::InternStrong(int32_t utf16_length,
- const char* utf8_data) {
+mirror::String* InternTable::InternStrong(int32_t utf16_length, const char* utf8_data) {
+ DCHECK(utf8_data != nullptr);
return InternStrong(mirror::String::AllocFromModifiedUtf8(
Thread::Current(), utf16_length, utf8_data));
}
mirror::String* InternTable::InternStrong(const char* utf8_data) {
- return InternStrong(
- mirror::String::AllocFromModifiedUtf8(Thread::Current(), utf8_data));
+ DCHECK(utf8_data != nullptr);
+ return InternStrong(mirror::String::AllocFromModifiedUtf8(Thread::Current(), utf8_data));
}
mirror::String* InternTable::InternStrong(mirror::String* s) {