Merge pull request #190 from YashasSamaga/i154-fix
trigger error if an array of unknown size is being returned
This commit is contained in:
commit
2a85a9fa33
@ -2016,7 +2016,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;
|
||||
|
@ -128,7 +128,8 @@ static char *errmsg[] = {
|
||||
/*088*/ "public variables and local variables may not have states (symbol \"%s\")\n",
|
||||
/*089*/ "state variables may not be initialized (symbol \"%s\")\n",
|
||||
/*090*/ "public functions may not return arrays (symbol \"%s\")\n",
|
||||
/*091*/ "ambiguous constant; tag override is required (symbol \"%s\")\n"
|
||||
/*091*/ "ambiguous constant; tag override is required (symbol \"%s\")\n",
|
||||
/*092*/ "functions may not return arrays of unknown size (symbol \"%s\")\n"
|
||||
};
|
||||
|
||||
static char *fatalmsg[] = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user