From d352d8ead36424ea7093e1890ff7f3d5de6bfe3d Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 20 Apr 2015 10:57:49 +0200 Subject: [PATCH] vhdlpp: Stop compilation on invalid attributes. --- vhdlpp/expression_evaluate.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vhdlpp/expression_evaluate.cc b/vhdlpp/expression_evaluate.cc index 983c0ed6b..b67cbd5da 100644 --- a/vhdlpp/expression_evaluate.cc +++ b/vhdlpp/expression_evaluate.cc @@ -105,9 +105,10 @@ bool ExpAttribute::evaluate(ScopeBase*scope, int64_t&val) const const VTypeArray*arr = dynamic_cast(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; } @@ -145,9 +146,10 @@ bool ExpAttribute::evaluate(Entity*ent, ScopeBase*scope, int64_t&val) const const VTypeArray*arr = dynamic_cast(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; }