mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
more liberal view of attribute equality; allow suppressing attr type-checking
This commit is contained in:
parent
6898c36c51
commit
d5e6d8e249
2 changed files with 10 additions and 6 deletions
|
@ -208,7 +208,10 @@ void Attributes::AddAttr(AttrPtr attr, bool is_redef)
|
||||||
attrs.emplace_back(attr);
|
attrs.emplace_back(attr);
|
||||||
|
|
||||||
// We only check the attribute after we've added it, to facilitate
|
// We only check the attribute after we've added it, to facilitate
|
||||||
// generating error messages via Attributes::Describe.
|
// generating error messages via Attributes::Describe. If the
|
||||||
|
// instantiator of the object specified a null type, however, then
|
||||||
|
// that's a signal to skip the checking.
|
||||||
|
if ( type )
|
||||||
CheckAttr(attr.get());
|
CheckAttr(attr.get());
|
||||||
|
|
||||||
// For ADD_FUNC or DEL_FUNC, add in an implicit REDEF, since
|
// For ADD_FUNC or DEL_FUNC, add in an implicit REDEF, since
|
||||||
|
|
|
@ -86,10 +86,11 @@ public:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( expr || other.expr )
|
if ( expr || other.expr )
|
||||||
// If any has an expression and they aren't the same object, we
|
// Too hard to check for equivalency, since one
|
||||||
// declare them unequal, as we can't really find out if the two
|
// might be expressed/compiled differently than
|
||||||
// expressions are equivalent.
|
// the other, so assume they're compatible, as
|
||||||
return (expr == other.expr);
|
// long as both are present.
|
||||||
|
return expr && other.expr;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue