missing error checking related to ([...]int){...}

R=ken
OCL=35132
CL=35132
This commit is contained in:
Russ Cox 2009-09-29 21:23:34 -07:00
parent 08eefec9d6
commit e7f9452da5
2 changed files with 6 additions and 1 deletions

View File

@ -323,7 +323,7 @@ variter(NodeList *vl, Node *t, NodeList *el)
declare(v, dclcontext);
v->ntype = t;
if(e != N || funcdepth > 0) {
if(e != N || funcdepth > 0 || isblank(v)) {
if(funcdepth > 0)
init = list(init, nod(ODCL, v, N));
e = nod(OAS, v, e);

View File

@ -1010,6 +1010,11 @@ ret:
case TNIL:
case TBLANK:
break;
case TARRAY:
if(t->bound == -100) {
yyerror("use of [...] array outside of array literal");
t->bound = 1;
}
default:
checkwidth(t);
}