Restore result variable just for issue #40 using same fix as J. Templ.

This commit is contained in:
David Brown 2016-10-28 21:00:07 +01:00
parent 6a4748e2af
commit 03556336ce
22 changed files with 171 additions and 5 deletions

View file

@ -1490,6 +1490,20 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
} else {
OPM_WriteString((CHAR*)"__ENDMOD", 9);
}
} else if (OPC_NeedsRetval(outerProc)) {
OPM_WriteString((CHAR*)"__retval = ", 12);
if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) {
OPM_WriteString((CHAR*)"(void*)", 8);
OPV_expr(n->left, 10);
} else {
OPV_expr(n->left, -1);
}
OPC_EndStat();
OPC_BegStat();
OPC_ExitProc(outerProc, 0, 0);
OPC_EndStat();
OPC_BegStat();
OPM_WriteString((CHAR*)"return __retval", 16);
} else {
OPC_ExitProc(outerProc, 0, 0);
OPM_WriteString((CHAR*)"return", 7);