Commit 5676012c authored by Robert Ricci's avatar Robert Ricci

Fix a pclass bug - we weren't correctly handling the case where one

pnode's types were a subset of another's.
parent 828c8b73
...@@ -74,6 +74,17 @@ int pclass_equiv(tb_pgraph &PG, tb_pnode *a,tb_pnode *b) ...@@ -74,6 +74,17 @@ int pclass_equiv(tb_pgraph &PG, tb_pnode *a,tb_pnode *b)
if ((bit == b->types.end()) || ! ( *(*bit).second == *a_type_record) ) if ((bit == b->types.end()) || ! ( *(*bit).second == *a_type_record) )
return 0; return 0;
} }
// We have to check in both directions, or b might have a type that a does
// not
for (tb_pnode::types_map::iterator it=b->types.begin();
it!=b->types.end();++it) {
const crope &b_type = (*it).first;
tb_pnode::type_record *b_type_record = (*it).second;
tb_pnode::types_map::iterator bit = a->types.find(b_type);
if ((bit == a->types.end()) || ! ( *(*bit).second == *b_type_record) )
return 0;
}
// check subnode information // check subnode information
if (a->subnode_of != b->subnode_of) { if (a->subnode_of != b->subnode_of) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment