Skip to content

Commit

Permalink
vhdlpp: Stop compilation on invalid attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
orsonmmz committed May 6, 2015
1 parent 1b3e321 commit 9de4ced
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vhdlpp/expression_evaluate.cc
Expand Up @@ -105,9 +105,10 @@ bool ExpAttribute::evaluate(ScopeBase*scope, int64_t&val) const

const VTypeArray*arr = dynamic_cast<const VTypeArray*>(base_type);
if (arr == 0) {
cerr << get_fileline() << ": error: "
cerr << endl << get_fileline() << ": error: "
<< "Cannot apply the 'length attribute to non-array objects"
<< endl;
ivl_assert(*this, false);
return false;
}

Expand Down Expand Up @@ -145,9 +146,10 @@ bool ExpAttribute::evaluate(Entity*ent, ScopeBase*scope, int64_t&val) const

const VTypeArray*arr = dynamic_cast<const VTypeArray*>(base_type);
if (arr == 0) {
cerr << get_fileline() << ": error: "
cerr << endl << get_fileline() << ": error: "
<< "Cannot apply the '" << name_
<< " attribute to non-array objects" << endl;
ivl_assert(*this, false);
return false;
}

Expand Down

0 comments on commit 9de4ced

Please sign in to comment.