Index: runtime/vm/kernel.cc |
diff --git a/runtime/vm/kernel.cc b/runtime/vm/kernel.cc |
index 6953cea46d1e422c17a00c924b2534c468227bfc..ea314283a138ea34a4042a9ee5c7575848d02cf8 100644 |
--- a/runtime/vm/kernel.cc |
+++ b/runtime/vm/kernel.cc |
@@ -80,7 +80,9 @@ bool CanonicalName::IsMember() { |
// Note the two occurrences of the parameter 'literal'. |
#define COMPARE_NAME(canonical_name, literal) \ |
- memcmp((canonical_name)->name()->buffer(), (literal), strlen(literal)) == 0 |
+ ((canonical_name)->name()->size() == strlen(literal) && \ |
+ memcmp((canonical_name)->name()->buffer(), (literal), strlen(literal)) == \ |
+ 0) |
bool CanonicalName::IsField() { |
// Fields with private names have the import URI of the library where they are |