Ignore system tasks/functions NULL arguments in @* calculation.

System tasks and functions can be defined to have NULL arguments.
This patch makes the @* sensitivity list calculation skip these
NULL (constant) arguments.
(cherry picked from commit 9477154e5b)
This commit is contained in:
Cary R 2010-11-16 14:36:53 -08:00 committed by Stephen Williams
parent 8dea333521
commit 15bff3a23b
1 changed files with 22 additions and 8 deletions

View File

@ -123,16 +123,23 @@ NexusSet* NetESelect::nex_input(bool rem_out)
return result;
}
/*
* The $fread, etc. system functions can have NULL arguments.
*/
NexusSet* NetESFunc::nex_input(bool rem_out)
{
if (nparms_ == 0)
return new NexusSet;
NexusSet*result = parms_[0]->nex_input(rem_out);
NexusSet*result;
if (parms_[0]) result = parms_[0]->nex_input(rem_out);
else result = new NexusSet;
for (unsigned idx = 1 ; idx < nparms_ ; idx += 1) {
NexusSet*tmp = parms_[idx]->nex_input(rem_out);
result->add(*tmp);
delete tmp;
if (parms_[idx]) {
NexusSet*tmp = parms_[idx]->nex_input(rem_out);
result->add(*tmp);
delete tmp;
}
}
return result;
}
@ -387,16 +394,23 @@ NexusSet* NetRepeat::nex_input(bool rem_out)
return result;
}
/*
* The $display, etc. system tasks can have NULL arguments.
*/
NexusSet* NetSTask::nex_input(bool rem_out)
{
if (parms_.count() == 0)
return new NexusSet;
NexusSet*result = parms_[0]->nex_input(rem_out);
NexusSet*result;
if (parms_[0]) result = parms_[0]->nex_input(rem_out);
else result = new NexusSet;
for (unsigned idx = 1 ; idx < parms_.count() ; idx += 1) {
NexusSet*tmp = parms_[idx]->nex_input(rem_out);
result->add(*tmp);
delete tmp;
if (parms_[idx]) {
NexusSet*tmp = parms_[idx]->nex_input(rem_out);
result->add(*tmp);
delete tmp;
}
}
return result;