fix(util/name): segfault on name() == "foo"

Fixes #1505
This commit is contained in:
Sebastian Ullrich 2017-04-03 12:30:20 +02:00
parent 7e7a4e01ab
commit 7ac2f1be89

View file

@ -203,7 +203,7 @@ bool is_prefix_of(name const & n1, name const & n2) {
}
bool operator==(name const & a, char const * b) {
return a.m_ptr->m_is_string && strcmp(a.m_ptr->m_str, b) == 0;
return a.m_ptr && a.m_ptr->m_is_string && strcmp(a.m_ptr->m_str, b) == 0;
}
int cmp(name::imp * i1, name::imp * i2) {