Fixed compiler asserting when returning a string literal (bug 3836, r=fyren).
This commit is contained in:
parent
c4b17855e5
commit
752bd78de5
@ -6371,6 +6371,11 @@ static void doreturn(void)
|
|||||||
error(78); /* mix "return;" and "return value;" */
|
error(78); /* mix "return;" and "return value;" */
|
||||||
ident=doexpr(TRUE,FALSE,TRUE,FALSE,&tag,&sym,TRUE);
|
ident=doexpr(TRUE,FALSE,TRUE,FALSE,&tag,&sym,TRUE);
|
||||||
needtoken(tTERM);
|
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) */
|
/* see if this function already has a sub type (an array attached) */
|
||||||
sub=finddepend(curfunc);
|
sub=finddepend(curfunc);
|
||||||
assert(sub==NULL || sub->ident==iREFARRAY);
|
assert(sub==NULL || sub->ident==iREFARRAY);
|
||||||
|
Loading…
Reference in New Issue
Block a user