Fix assignment of outputs from class methods.

As for inputs, skip over the implicit 'this' parameter.

(cherry picked from commit e316cc708b)
This commit is contained in:
Martin Whitaker 2016-07-21 19:06:21 +01:00
parent 73d688c313
commit 07623bef2e
1 changed files with 7 additions and 5 deletions

View File

@ -3817,7 +3817,9 @@ NetProc* PCallTask::elaborate_build_call_(Design*des, NetScope*scope,
expression that can be a target to a procedural
assignment, including a memory word. */
for (unsigned idx = 0 ; idx < parm_count ; idx += 1) {
for (unsigned idx = use_this?1:0 ; idx < parm_count ; idx += 1) {
size_t parms_idx = use_this? idx-1 : idx;
NetNet*port = def->port(idx);
@ -3833,12 +3835,12 @@ NetProc* PCallTask::elaborate_build_call_(Design*des, NetScope*scope,
message. Note that the elaborate_lval method already
printed a detailed message for the latter case. */
NetAssign_*lv = 0;
if (idx < parms_.size() && parms_[idx]) {
lv = parms_[idx]->elaborate_lval(des, scope, false, false);
if (parms_idx < parms_.size() && parms_[parms_idx]) {
lv = parms_[parms_idx]->elaborate_lval(des, scope, false, false);
if (lv == 0) {
cerr << parms_[idx]->get_fileline() << ": error: "
cerr << parms_[parms_idx]->get_fileline() << ": error: "
<< "I give up on task port " << (idx+1)
<< " expression: " << *parms_[idx] << endl;
<< " expression: " << *parms_[parms_idx] << endl;
}
} else if (port->port_type() == NetNet::POUTPUT) {
// Output ports were skipped earlier, so