Index: runtime/vm/service.cc |
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc |
index c456fee51e9516a6f5088e970b5e4f7e47cf6322..2e96b66bf84085e085f7ecc609f8285e18a0b262 100644 |
--- a/runtime/vm/service.cc |
+++ b/runtime/vm/service.cc |
@@ -1515,16 +1515,23 @@ static RawObject* LookupHeapObjectLibraries(Isolate* isolate, |
const GrowableObjectArray& libs = |
GrowableObjectArray::Handle(isolate->object_store()->libraries()); |
ASSERT(!libs.IsNull()); |
- intptr_t id = 0; |
- if (!GetIntegerId(parts[1], &id)) { |
- return Object::sentinel().raw(); |
+ const String& id = String::Handle(String::New(parts[1])); |
+ // Scan for private key. |
+ String& private_key = String::Handle(); |
+ Library& lib = Library::Handle(); |
+ bool lib_found = false; |
+ for (intptr_t i = 0; i < libs.Length(); i++) { |
+ lib ^= libs.At(i); |
+ ASSERT(!lib.IsNull()); |
+ private_key ^= lib.private_key(); |
+ if (private_key.Equals(id)) { |
+ lib_found = true; |
+ break; |
+ } |
} |
- if ((id < 0) || (id >= libs.Length())) { |
+ if (!lib_found) { |
return Object::sentinel().raw(); |
} |
- Library& lib = Library::Handle(); |
- lib ^= libs.At(id); |
- ASSERT(!lib.IsNull()); |
if (num_parts == 2) { |
return lib.raw(); |
} |