vhdlpp: ExpUnary::elaborate_expr() elaborates its operand as well.

Fix for br985.
This commit is contained in:
Maciej Suminski 2015-08-09 18:15:50 +02:00
parent f3321126ed
commit 0ae3414ec5
2 changed files with 8 additions and 9 deletions

View File

@ -168,6 +168,7 @@ class ExpUnary : public Expression {
inline const Expression*peek_operand() const { return operand1_; }
const VType*fit_type(Entity*ent, ScopeBase*scope, const VTypeArray*atype) const;
int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype);
void visit(ExprVisitor& func);
protected:
@ -825,7 +826,6 @@ class ExpUNot : public ExpUnary {
Expression*clone() const { return new ExpUNot(peek_operand()->clone()); }
int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype);
void write_to_stream(std::ostream&fd) const;
int emit(ostream&out, Entity*ent, ScopeBase*scope);
void dump(ostream&out, int indent = 0) const;

View File

@ -373,6 +373,13 @@ const VType*ExpUnary::fit_type(Entity*ent, ScopeBase*scope, const VTypeArray*aty
return operand1_->fit_type(ent, scope, atype);
}
int ExpUnary::elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype)
{
ivl_assert(*this, ltype != 0);
set_type(ltype);
return operand1_->elaborate_expr(ent, scope, ltype);
}
const VType*ExpAggregate::probe_type(Entity*ent, ScopeBase*scope) const
{
return Expression::probe_type(ent, scope);
@ -1043,14 +1050,6 @@ int ExpString::elaborate_expr(Entity*, ScopeBase*, const VType*ltype)
return 0;
}
int ExpUNot::elaborate_expr(Entity*, ScopeBase*, const VType*ltype)
{
ivl_assert(*this, ltype != 0);
set_type(ltype);
return 0;
}
int ExpTime::elaborate_expr(Entity*, ScopeBase*, const VType*)
{
set_type(&primitive_INTEGER);