Finish implementation of ResolveField and ResolveMethod
Change-Id: I854e17b4cccd05b26f83c77230f7323c898802c9
diff --git a/src/dex_file.cc b/src/dex_file.cc
index c828df6..f7dec88 100644
--- a/src/dex_file.cc
+++ b/src/dex_file.cc
@@ -383,7 +383,6 @@
// must assemble the descriptor from references in the prototype.
char* DexFile::CreateMethodDescriptor(uint32_t proto_idx,
int32_t* unicode_length) const {
- CHECK(unicode_length != NULL);
const ProtoId& proto_id = GetProtoId(proto_idx);
std::string descriptor;
descriptor.push_back('(');
@@ -408,7 +407,9 @@
// TODO: should this just return a std::string?
scoped_ptr<char> c_string(new char[descriptor.size() + 1]);
strcpy(c_string.get(), descriptor.c_str());
- *unicode_length = parameter_length + return_type_length + 2; // 2 for ( and )
+ if (unicode_length != NULL) {
+ *unicode_length = parameter_length + return_type_length + 2; // 2 for ( and )
+ }
return c_string.release();
}