trigger an error if an array of unknown size is returned

This commit is contained in:
Yashas 2017-09-29 16:21:33 +05:30 committed by GitHub
parent 1efcf90a28
commit 00a1cd7e88

View File

@ -1984,7 +1984,9 @@ static int nesting=0;
* reserved memory block as a hidden parameter
*/
retsize=(int)array_totalsize(symret);
assert(retsize>0);
if (retsize<=0) {
error(92,sym->name);
} /* if */
modheap(retsize*sizeof(cell));/* address is in ALT */
pushreg(sALT); /* pass ALT as the last (hidden) parameter */
decl_heap+=retsize;