diff --git a/source/compiler/sc3.c b/source/compiler/sc3.c index d717968..f7e15f6 100644 --- a/source/compiler/sc3.c +++ b/source/compiler/sc3.c @@ -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; diff --git a/source/compiler/sc5.c b/source/compiler/sc5.c index 34a1c77..8f81319 100644 --- a/source/compiler/sc5.c +++ b/source/compiler/sc5.c @@ -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[] = {