diff --git a/src/Attr.cc b/src/Attr.cc index 6850c80b5f..976fde083e 100644 --- a/src/Attr.cc +++ b/src/Attr.cc @@ -208,8 +208,11 @@ void Attributes::AddAttr(AttrPtr attr, bool is_redef) attrs.emplace_back(attr); // We only check the attribute after we've added it, to facilitate - // generating error messages via Attributes::Describe. - CheckAttr(attr.get()); + // 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()); // For ADD_FUNC or DEL_FUNC, add in an implicit REDEF, since // those attributes only have meaning for a redefinable value. diff --git a/src/Attr.h b/src/Attr.h index 5f1f2ab59f..9c29c4ccd0 100644 --- a/src/Attr.h +++ b/src/Attr.h @@ -86,10 +86,11 @@ public: return false; if ( expr || other.expr ) - // If any has an expression and they aren't the same object, we - // declare them unequal, as we can't really find out if the two - // expressions are equivalent. - return (expr == other.expr); + // Too hard to check for equivalency, since one + // might be expressed/compiled differently than + // the other, so assume they're compatible, as + // long as both are present. + return expr && other.expr; return true; }