diff --git a/compiler/libpc300/sc1.c b/compiler/libpc300/sc1.c index 7a097918..1cdcf643 100755 --- a/compiler/libpc300/sc1.c +++ b/compiler/libpc300/sc1.c @@ -5251,6 +5251,11 @@ static void doreturn(void) error(78); /* mix "return;" and "return value;" */ ident=doexpr(TRUE,FALSE,TRUE,TRUE,&tag,&sym,TRUE); needtoken(tTERM); + if (ident == iARRAY && sym == NULL) { + /* returning a literal string is not supported (it must be a variable) */ + error(39); + ident = iCONSTEXPR; /* avoid handling an "array" case */ + } /* if */ /* see if this function already has a sub type (an array attached) */ sub=finddepend(curfunc); assert(sub==NULL || sub->ident==iREFARRAY);