Fix GitHub issue #361 - explicit cast check on function return value.

A function call returning an enumeration value can be assigned to an
enumeration variable without an explict cast.

(cherry picked from commit bd0133b386)
This commit is contained in:
Martin Whitaker 2020-08-14 12:30:05 +01:00
parent fabdf42365
commit e013745035
2 changed files with 9 additions and 0 deletions

View File

@ -2154,6 +2154,14 @@ ivl_variable_type_t NetEUFunc::expr_type() const
return IVL_VT_VOID;
}
const netenum_t* NetEUFunc::enumeration() const
{
if (result_sig_)
return result_sig_->enumeration();
return 0;
}
NetUTask::NetUTask(NetScope*def)
: task_(def)
{

View File

@ -3714,6 +3714,7 @@ class NetEUFunc : public NetExpr {
const NetScope* func() const;
virtual ivl_variable_type_t expr_type() const;
virtual const netenum_t* enumeration() const;
virtual void dump(ostream&) const;
virtual void expr_scan(struct expr_scan_t*) const;