mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Implement equivalence relation for opaque types.
This commit is contained in:
parent
fa9aeeaaf1
commit
2494940d95
2 changed files with 6 additions and 3 deletions
|
@ -1754,8 +1754,11 @@ int same_type(const BroType* t1, const BroType* t2, int is_init)
|
||||||
return same_type(t1->YieldType(), t2->YieldType(), is_init);
|
return same_type(t1->YieldType(), t2->YieldType(), is_init);
|
||||||
|
|
||||||
case TYPE_OPAQUE:
|
case TYPE_OPAQUE:
|
||||||
// FIXME: Should we downcast here and compare the opaque type names?
|
{
|
||||||
return 1;
|
const OpaqueType* ot1 = (const OpaqueType*) t1;
|
||||||
|
const OpaqueType* ot2 = (const OpaqueType*) t2;
|
||||||
|
return ot1->Name() == ot2->Name() ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
case TYPE_TYPE:
|
case TYPE_TYPE:
|
||||||
return same_type(t1, t2, is_init);
|
return same_type(t1, t2, is_init);
|
||||||
|
|
|
@ -505,7 +505,7 @@ public:
|
||||||
OpaqueType(const string& name);
|
OpaqueType(const string& name);
|
||||||
virtual ~OpaqueType() { };
|
virtual ~OpaqueType() { };
|
||||||
|
|
||||||
const string& Name() { return name; }
|
const string& Name() const { return name; }
|
||||||
|
|
||||||
void Describe(ODesc* d) const;
|
void Describe(ODesc* d) const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue