diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index 28c6606d..1a99d06c 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -6362,6 +6362,11 @@ static void doreturn(void) error(78); /* mix "return;" and "return value;" */ ident=doexpr(TRUE,FALSE,TRUE,FALSE,&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);